Skip to content

Document the sourceMap option in README #285

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

Closed
edmorley opened this issue Sep 25, 2018 · 7 comments · Fixed by #481
Closed

Document the sourceMap option in README #285

edmorley opened this issue Sep 25, 2018 · 7 comments · Fixed by #481

Comments

@edmorley
Copy link

Hi!

Currently the sourceMap option is not mentioned in the README:

this.sourceMap = sourceMap;

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.

@glen-84
Copy link

glen-84 commented Dec 14, 2018

@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?

@Ginhing
Copy link

Ginhing commented Jan 10, 2019

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?

@alexander-akait
Copy link
Member

PR welcome

@jefferyto
Copy link

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 😉

@bitfella
Copy link

@evilebottnawi please clarify the use of sourceMap option so we can eventually send PR. Thanks.

@alexander-akait
Copy link
Member

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

@alexander-akait
Copy link
Member

Unfortunately we have another bug with source maps #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants