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.
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.
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 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 emitteddevtoolModuleFilenameTemplate
gets called, producing things like:webpack://webpack://styles.less
. This issue occurs irrespective of whetherCSSSplitWebpackPlugin
is enabled or not. See https://github.com/webpack/css-loader/issues/280 for additional information.