-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
45 lines (42 loc) · 1.04 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
33
34
35
36
37
38
39
40
41
42
43
44
45
// webpack配置文件
module.exports = {
// 使用chainwebpack配置开发和发布的入口
chainWebpack: config => {
// 发布
config.when(process.env.NODE_ENV === "production", config => {
config
.entry("app")
.clear()
.add("./src/main-prod.js");
config.set("externals", {
vue: "Vue",
"vue-router": "VueRouter",
axios: "axios",
lodash: "_",
echarts: "echarts",
nprogress: "NProgress",
"vue-quill-editor": "VueQuillEditor"
});
config.plugin("html").tap(args => {
args[0].isProd = true;
return args;
});
});
// 开发
config.when(process.env.NODE_ENV === "development", config => {
config
.entry("app")
.clear()
.add("./src/main-dev.js");
config.plugin("html").tap(args => {
args[0].isProd = false;
return args;
});
});
},
publicPath: "./",
outputDir: "dist",
assetsDir: "static",
indexPath: "index.html",
filenameHashing: true
};