动态改变颜色

Former-commit-id: ffb048da436b289c2e2651bd4496b161c9157146 [formerly ffb048da436b289c2e2651bd4496b161c9157146 [formerly ffb048da436b289c2e2651bd4496b161c9157146 [formerly ffb048da436b289c2e2651bd4496b161c9157146 [formerly a59428acb527bc6321c95fa760265dc833cf65e5 [formerly 45ec9aef742e446120981b198f8218987b672a1f]]]]]
Former-commit-id: 70d862d8e2078eafcec732ed447786d07c1e1430
Former-commit-id: 0a9e379b6fdcca1e745cba5e1be77b583e82ae58
Former-commit-id: 863a82d72ccc3a9d1bbcc8d7aa79f3d7660a973e [formerly c13c2a3bc22f90100f318e6893fb3c4abf7f8095]
Former-commit-id: e5fb7675c964ee555398f2ecbdfbf8d1d59d75c1
Former-commit-id: 89c8cd222507e826ad8fdda0cad8f3f37ed912bc
Former-commit-id: 758ef0f28887dded3b4f9a73839302f053870eba
Former-commit-id: e477522484af89ef63cf16c8e4bb1ced4bdbe242
Former-commit-id: e7249fde10c183f40e99c3ad5810815ac755dfab
This commit is contained in:
liyang
2019-06-11 21:24:38 +08:00
parent 1a9277cc53
commit c5ea5a2bdb
12 changed files with 177 additions and 30 deletions

View File

@@ -1,6 +1,9 @@
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const VueFilenameInjector = require('./tools/vue-filename-injector')
const ThemeColorReplacer = require('webpack-theme-color-replacer')
const forElementUI = require('webpack-theme-color-replacer/forElementUI')
// 拼接路径
const resolve = dir => require('path').join(__dirname, dir)
@@ -26,6 +29,22 @@ module.exports = {
}
}
},
// node_modules 需要babel成es5的包
transpileDependencies: [
'webpack-theme-color-replacer'
],
configureWebpack: {
plugins: [
new ThemeColorReplacer({
fileName: 'css/theme-colors.[contenthash:8].css',
matchColors: [
...forElementUI.getElementUISeries(process.env.VUE_APP_ELEMENT_COLOR) // Element-ui主色系列
],
externalCssFiles: [ './node_modules/element-ui/lib/theme-chalk/index.css' ], // optional, String or string array. Set external css files (such as cdn css) to extract colors.
changeSelector: forElementUI.changeSelector
})
]
},
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack: config => {
/**