-
Notifications
You must be signed in to change notification settings - Fork 58
cssnano options not correct pass to cssnano #71
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
Comments
I am also having this issue when trying to pass arguments to cssnano. I am trying to get the reduceIndents flag set to false so it will stop mangling my animations. |
I've spend most of today running webpack with the Chrome DevTools to track this down. If you need a quick fix in the meantime:
It's not tidy, but it should let you enable Autoprefixer and the other "advanced" cssnano optimisations. In optimization: {
minimizer: [
new UglifyJsPlugin({ sourceMap: true }),
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
map: true,
preset: ['advanced', {
autoprefixer: { add: true },
}],
},
}),
],
}, |
thanks,i have change the source code. but i have to maintain a fork package,hope it work at next release. |
Having this issue too, I was tracking the option object which cssnano didn't receive. Found the same situation. |
Includes temporary subset of 'optimize-css-assets-webpack-plugin' via postcss to make chunk scoped optimization possible, that should be removed when NMFR/optimize-css-assets-webpack-plugin#71 is resolved.
Same issue, I have tracked the problem at postcss/postcss.es6#L125
and optimize-css-assets-webpack-plugin/index.js#L62
so the problem is, @zcs19871221 My temporary hack is rewrite the
|
Yes, it seems like optimize-css-assets-webpack-plugin follows this PostCSS documentation, but the |
#73 solved this. If not tell me so i can reopen the issue. |
when set in webpack in optimization like this:
new OptimizeCSSAssetsPlugin({ cssProcessorOptions: { calc: false } }),
i found the option not pass,in the cssnano module quickstart.js file, it works this:
const cssnanoOpts = { preset: [ 'default', { calc: false, } ] }; cssnano.process(css, postcssOpts, cssnanoOpts).then(result => { console.log(result.css); });
but in this plugin, use this:
return this.options.cssProcessor.process(css.source, processOptions)
maybe it is a version problem, but after i change source code it do well.my cssnano version is 4.0.2, optimize-css-assets-webpack-plugin version is 5.0.0. hope to solve it . thanks.
The text was updated successfully, but these errors were encountered: