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

Documentation should be explicit about the default configs for development and production modes #2080

Open
Maximaximum opened this issue Apr 26, 2018 · 5 comments
Assignees

Comments

@Maximaximum
Copy link

Do you want to request a feature or report a bug?
documentation

What is the current behavior?
I've spent quite some time trying to figure out what is the exact configuration that is used when mode is set to production, but haven't found a clear answer yet.

I need to tweak a single config option (collapse_vars) for the UglifyJsPlugin and, as far as I see, there is no way to do it, except for setting mode to none and explicitly re-defining the whole production config, having the only difference from the default production config that UglifyJsPlugin.uglifyOptions.collapse_vars = false. But how do I know the default production config? I can't find it in the documentation, so I'm trying to find this out by trial and errors, which is totally counter-productive.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
It would be great if on this page https://webpack.js.org/concepts/mode/, instead of some weird diffs there were full and exact configs that are equivalent to setting mode to development or production.

If this is a feature request, what is motivation or use case for changing the behavior?
The user should be able to easily copy-and-paste the default config and tweak it to their needs.

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.
This issue has been copied from webpack/webpack#7123 (comment)

@montogeek
Copy link
Member

montogeek commented Apr 26, 2018

Full and exact configuration are described in https://webpack.js.org/concepts/mode/#usage
image

How do you think the documentation should be?

@edmorley
Copy link
Contributor

edmorley commented Apr 26, 2018

@montogeek - I believe the OP is referring to things like these defaults, which are not documented anywhere other than in the source (I had to resort to the source too; so I agree with the OP's point):
https://github.com/webpack/webpack/blob/v4.6.0/lib/WebpackOptionsDefaulter.js#L273-L289

@montogeek
Copy link
Member

@edmorley Thanks for clarification, I agree, we should add complete documentation for all the options used by these plugins.

Send a PR.

@Maximaximum
Copy link
Author

@edmorley thanks for your help; indeed, that is what I mean

@montogeek montogeek self-assigned this Apr 26, 2018
@kremerd
Copy link
Contributor

kremerd commented Jul 17, 2018

There's also the devtool setting, which is automatically set to 'eval' in development mode.

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

No branches or pull requests

4 participants