-
-
Notifications
You must be signed in to change notification settings - Fork 384
fix: contextify sourceMap #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not contextify source map, it should be done on css-loader side, webpack need to absolute sources
@evilebottnawi I don't think it should be done on css-loader side. Even if do it on css-loader side, it does not guarantee the other loaders contextify. So I think it should do on this plugin. Webpack is also contextify source map first and don't need to absolute sources. |
No, we need absolute sources for webpack, you break source maps, other CSS files on a page can have source maps too with relative sources (for example
postcss-loader doesn't create source maps with absolute paths |
@helloyou2012 It is a bug in |
path.resolve return absoluted paths. |
@helloyou2012 yep, but they may not necessarily be relatively to current process cwd |
So postcss-loader should keep the original relative path and no need resolve it? |
@helloyou2012 postcss-loader should generate right sources with absolute paths, css-loader should contextify using |
why not contextify using webapck:// on this plugin? |
@helloyou2012 because this plugins should not do it |
@helloyou2012 and we still have the same problem with |
Is this pr to fix this bug? |
@helloyou2012 yep, bug we need a new a PR, |
Codecov Report
@@ Coverage Diff @@
## master #533 +/- ##
==========================================
- Coverage 88.55% 87.38% -1.17%
==========================================
Files 5 5
Lines 428 444 +16
Branches 96 105 +9
==========================================
+ Hits 379 388 +9
- Misses 47 51 +4
- Partials 2 5 +3
Continue to review full report at Codecov.
|
Fixed on |
Just update |
This PR contains a:
Motivation / Use-Case
some loader (like postcss-loader) generate the source map with the absolute path. Cause contentHash differences on different project paths.
Breaking Changes
Additional Info