Repository navigation
fix: contextify sourceMap - #533
helloyou2012 wants to merge 4 commits into
Conversation
alexander-akait
left a comment
There was a problem hiding this comment.
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