Hi!
Currently the sourceMap option is not mentioned in the README:
https://github.com/webpack-contrib/mini-css-extract-plugin/blob/aa993daa12a45a326abcdd4f19dcba76db35ed8a/src/index.js#L29
I presume it's required to be set to true to enable source maps, so it seems important to mention it in the README, given at the moment the top of the readme says "It supports On-Demand-Loading of CSS and SourceMaps" - which isn't true out of the box.
@evilebottnawi,
It's very unclear at the moment whether or not this needs to be set in the loader options for MCEP.
What is the default value? Is it inherited from another loader or the webpack options?
Hi!
I have set the option to false to stop generating source maps, but it doesn't work as I expected.
Is the option sourceMap a "broken" option so that it is not documented ? Any other ways to disable source maps?
PR welcome
I don't believe sourceMap is an accepted plugin option. That sourceMap parameter in the quoted line is for the constructor of a CssDependency class, not the main plugin. I believe CssDependency is used to receive data from the previous loader (most likely css-loader), and so the sourceMap parameter is to receive the sourcemap (data/filename?) from css-loader.
@evilebottnawi if you can clarify whether sourceMap is a valid option or not, I think someone can then submit a PR to update the documentation :wink:
@evilebottnawi please clarify the use of sourceMap option so we can eventually send PR. Thanks.
Sorry for big delay, plugin doesn't have the sourceMap option, we don't need the option here, if you need disable source maps you need disable source maps on previous loader (i.e. css-loader). Also we improve 0CJS configuration, in next release css-loader will be emit source maps if you set devtools not false
Unfortunately we have another bug with source maps https://github.com/webpack-contrib/mini-css-extract-plugin/issues/223, you can disable a source map generation using devtools: false and sourceMap: false on css-loader, we will try to fix it in webpack@5