Skip to content

Readme on minimize option should inform about actual dynamic default value #650

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
jrencz opened this issue Dec 28, 2017 · 1 comment
Closed

Comments

@jrencz
Copy link

jrencz commented Dec 28, 2017

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

Bug (documentation)

What is the current behavior?
In a table there's an entry saying that minimize is false by default:

|**[`minimize`](#minimize)**|`{Boolean\|Object}`|`false`|Enable/Disable minification|

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

The default value depends on production setting of webpack (this.minimize is set to true when -p flag is used):

minimize: this.minimize,

It can be undone only by passing actual setting in a loader query:

var forceMinimize = query.minimize;

What is the expected behavior?

Docs should say that minimize has default value depending on webpack production setting.

If this is a feature request, what is motivation or use case for changing the behavior?

Rationale:
I'm trying to adopt browserslist configuration using shared browserslist config (introduced in v2)
css-loader depends on older version of cssnano, which has browserslist@1 as one of dependencies. I'm aware of why is that (#535 (comment)) and I didn't want to use baked-in cssnano anyway (I deliberately use [email protected] in my project)
It turned out that css-loader does use cssnano (in particular: the postcss-merge-rules, which depends on caniuse-db@1 which, in turn depends on browserslist@1) even though I don't ask it to. Or at least I thought I'm not asking it to. In fact I did by using -p flag when calling webpack.

I spent a fair amount of time figuring that out. I feel like the docs should give better insight into that cssnano transforms are used depending on webpack config.

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
webapck 3.10.0
node 8.9.1
macOS 10.13.2

Related issues:
#289

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

No branches or pull requests

2 participants