From 32577b038a7dbadef4a71234577804d65c682d34 Mon Sep 17 00:00:00 2001 From: iczer <1126263215@qq.com> Date: Wed, 8 Jul 2020 10:55:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20start=20problem=20in=20dev=20env;=20:bug?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=BC=80=E5=8F=91=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E7=9A=84=E5=90=AF=E5=8A=A8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/themeUtil.js | 1 - vue.config.js | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) 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: {