fix: start problem in dev env; 🐛

修复:开发环境下的启动问题;
master
iczer 4 years ago
parent 8cbde7bff5
commit 32577b038a
  1. 1
      src/utils/themeUtil.js
  2. 6
      vue.config.js

@ -13,7 +13,6 @@ module.exports = {
let palettes = generate(color, opts) let palettes = generate(color, opts)
const primary = palettes[5] const primary = palettes[5]
palettes = palettes.concat(generate(primary)) palettes = palettes.concat(generate(primary))
console.log(palettes)
const darkBgColors = getDarkColors(color, _theme) const darkBgColors = getDarkColors(color, _theme)
const _themeCfg = themeCfg[_theme] const _themeCfg = themeCfg[_theme]
const bgColors = Object.keys(_themeCfg) const bgColors = Object.keys(_themeCfg)

@ -21,12 +21,14 @@ module.exports = {
) )
}, },
chainWebpack: config => { chainWebpack: config => {
config // 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
.plugin('optimize-css') if (process.env.NODE_ENV === 'production') {
config.plugin('optimize-css')
.tap(args => { .tap(args => {
args[0].cssnanoOptions.preset[1].colormin = false args[0].cssnanoOptions.preset[1].colormin = false
return args return args
}) })
}
}, },
css: { css: {
loaderOptions: { loaderOptions: {

Loading…
Cancel
Save