[英]Cannot turn off colormin optimization from the cssnano configuration
I have the Webpack setup in which I use optimize-css-assets-webpack-plugin with cssnano as the CSS processor. 我有一个Webpack设置,在其中我使用了带有CSSNano作为CSS处理器的optimize-css-assets-webpack-plugin 。
In there, I don't want to use the colormin
optimization. 在这里,我不想使用colormin
优化。
Optimizations: https://cssnano.co/guides/optimisations 优化: https : //cssnano.co/guides/optimisations
This is my current configuration which doesn't stop converting HSL value to hex: 这是我当前的配置,不会停止将HSL值转换为十六进制:
plugins.push(new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.css$/g,
cssProcessor: require('cssnano'),
cssProcessorPluginOptions: {
preset: ['default', {
discardComments: {
removeAll: true,
},
colormin: false,
}],
},
canPrint: true,
}));
I need to know whats wrong with this configuration. 我需要知道此配置有什么问题。
Check the version of your optimize-css-assets-webpack-plugin and webpack. 检查您的optimize-css-assets-webpack-plugin和webpack的版本。 The last version of optimize-css-assets-webpack-plugin to support webpack 3 is version 3.2.0. 支持webpack 3的optimize-css-assets-webpack-plugin的最新版本是3.2.0版。 And that version is configured differently: 该版本的配置有所不同:
plugins.push(new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.css$/g,
cssProcessor: require('cssnano'),
cssProcessorOptions: {
discardComments: {
removeAll: true,
},
colormin: false,
},
canPrint: true,
}));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.