bootstarted / css-split-webpack-plugin

Split your CSS for stupid browsers using webpack and postcss.
78 stars 22 forks source link

Fix previous source map not being used correctly. #6

Closed izaakschroeder closed 8 years ago

izaakschroeder commented 8 years ago

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 https://github.com/metalabdesign/css-split-webpack-plugin/issues/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 https://github.com/webpack/css-loader/issues/280 for additional information.

izaakschroeder commented 8 years ago

/cc @jamesdphillips @jjt @nealgranger

10xjs commented 8 years ago

This will go.

jamesdphillips commented 8 years ago

itsagooda