forked from biubiubiu01/vue3-bigData
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
58 lines (55 loc) · 1.25 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
46
47
48
49
50
51
52
53
54
55
56
57
58
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
const name = process.env.VUE_APP_BASE_NAME || "Vue Data Admin";
module.exports = {
publicPath: "./",
outputDir: "dist",
lintOnSave: false,
productionSourceMap: false,
devServer: {
port: 8999,
open: true,
overlay: {
warnings: false,
errors: true,
},
before:
process.env.NODE_ENV == "development"
? require("./mock/mock-server.js")
: "",
},
configureWebpack: {
name: name,
resolve: {
alias: {
"@": resolve("src"),
"@UI": resolve("UI"),
},
},
},
chainWebpack(config) {
config.when(process.env.NODE_ENV !== "development", (config) => {
config.optimization.splitChunks({
chunks: "all",
cacheGroups: {
libs: {
name: "chunk-libs",
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: "initial",
},
commons: {
name: "chunk-commons",
test: resolve("src/components"),
minChunks: 3,
priority: 5,
reuseExistingChunk: true,
},
},
});
config.optimization.runtimeChunk("single");
});
},
};