Skip to content
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

Fix previous source map not being used correctly. #6

Merged
merged 1 commit into from
Jun 7, 2016

Conversation

izaakschroeder
Copy link
Contributor

@izaakschroeder izaakschroeder commented Jun 6, 2016

The previous source map should be applied in process, not in toResult even though the documentation says toResult 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 the less 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 emitted devtoolModuleFilenameTemplate gets called, producing things like: webpack://webpack://styles.less. This issue occurs irrespective of whether CSSSplitWebpackPlugin is enabled or not. See webpack-contrib/css-loader#280 for additional information.

The previous source map should be applied in `process`, not in `toResult` even though the documentation says `toResult` 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 the `less` CSS preprocessor.

Fixes #4.
@izaakschroeder
Copy link
Contributor Author

/cc @jamesdphillips @jjt @nealgranger

@10xjs
Copy link

10xjs commented Jun 6, 2016

This will go.

@jamesdphillips
Copy link

itsagooda

@izaakschroeder izaakschroeder merged commit a788847 into master Jun 7, 2016
@izaakschroeder izaakschroeder deleted the fix-source-maps branch June 7, 2016 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants