简体   繁体   English

无法从cssnano配置中关闭colormin优化

[英]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.

相关问题 我可以关闭优化,因此闭包中的范围内变量不会“优化” - can I turn off optimization, so in-scope variables from closures aren't “optimized out” 从Web浏览器打开/关闭移动手电筒 - Turn on / off mobile flashlight from a web browser Bokeh:如何从回调开启/关闭HoverTool? - Bokeh: how to turn HoverTool on/off from callback? Visual Studio 2022 无法关闭 JavaScript 调试 - Visual Studio 2022 CANNOT turn off JavaScript Debugging 关闭 - “阻止此页面创建其他对话框” - Turn Off - “prevent this page from creating additional dialogs” "如何从 parsley.js 表单验证中打开\/关闭字段" - How to turn on/off a field from parsley.js form validation 是否可以从 NextJS 中的“快速刷新”关闭控制台日志? - Is it possible to turn off console logs from "Fast Refresh" in NextJS? 如何最好地从应用程序的另一部分“关闭”网页? - How best to "turn off" a web page from another part of the application? 预加载器 - 从子页面返回主页面时如何将其关闭? - Preloader - how to turn it off when returning from the subpage to the main page? 在网站上打开和关闭声音 - turn sound on and off on a site
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM