diff --git a/src/utils/themeUtil.js b/src/utils/themeUtil.js index 6da2bae..4c1dff3 100644 --- a/src/utils/themeUtil.js +++ b/src/utils/themeUtil.js @@ -13,7 +13,6 @@ module.exports = { let palettes = generate(color, opts) const primary = palettes[5] palettes = palettes.concat(generate(primary)) - console.log(palettes) const darkBgColors = getDarkColors(color, _theme) const _themeCfg = themeCfg[_theme] const bgColors = Object.keys(_themeCfg) diff --git a/vue.config.js b/vue.config.js index e894155..5407f88 100644 --- a/vue.config.js +++ b/vue.config.js @@ -21,12 +21,14 @@ module.exports = { ) }, chainWebpack: config => { - config - .plugin('optimize-css') - .tap(args => { - args[0].cssnanoOptions.preset[1].colormin = false - return args - }) + // 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突 + if (process.env.NODE_ENV === 'production') { + config.plugin('optimize-css') + .tap(args => { + args[0].cssnanoOptions.preset[1].colormin = false + return args + }) + } }, css: { loaderOptions: {