-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
32 lines (30 loc) · 1.03 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { defineConfig } = require("@vue/cli-service");
// 换肤插件
// https://github.com/hzsrc/webpack-theme-color-replacer
const ThemeColorReplacer = require("webpack-theme-color-replacer");
const forElementUI = require("webpack-theme-color-replacer/forElementUI");
module.exports = defineConfig({
transpileDependencies: true,
publicPath: process.env.NODE_ENV === "production" ? "/theme-starter/" : "/",
outputDir: "docs",
configureWebpack: {
devServer: {
host: "localhost",
},
},
// 换肤配置
chainWebpack: (config) => {
config
.plugin("webpack-theme-color-replacer")
.use(ThemeColorReplacer)
.tap((options) => {
options[0] = {
fileName: "css/theme-colors-[contenthash:8].css",
matchColors: forElementUI.getElementUISeries("#409EFF"), // 根据默认主题色生成从深到浅一系列色值
changeSelector: forElementUI.changeSelector,
isJsUgly: process.env.NODE_ENV !== "development",
};
return options;
});
},
});