Fix previous source map not being used correctly. #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous source map should be applied in
process
, not intoResult
even though the documentation saystoResult
supports these properties. See: https://github.com/postcss/postcss/blob/master/docs/api.md#roottoresultopts for information on this API. Additional tests have been added to verify this behavior, including the addition of a more complex example using theless
CSS preprocessor.Fixes #4.
There is still an issues involving the source filenames within the source map but that issue does not appear to be related. Namely that https://github.com/webpack/css-loader/blob/7d2abbaa82a093fa9b71223e1b5ab485cf7e9623/lib/loader.js#L106 injects
webpack://
into the sourcemap source list always, and then on the second pass when everything gets emitteddevtoolModuleFilenameTemplate
gets called, producing things like:webpack://webpack://styles.less
. This issue occurs irrespective of whetherCSSSplitWebpackPlugin
is enabled or not. See webpack-contrib/css-loader#280 for additional information.