-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvue.config.js
More file actions
59 lines (49 loc) · 1.15 KB
/
vue.config.js
File metadata and controls
59 lines (49 loc) · 1.15 KB
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
59
const CompressionPlugin = require("compression-webpack-plugin");
const cdn = {
css: ["//unpkg.com/element-ui@2.13.1/lib/theme-chalk/index.css"],
js: [
"//cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.min.js",
"//unpkg.com/vue-router@2.8.1/dist/vue-router.min.js",
"//unpkg.com/element-ui@2.13.1/lib/index.js",
"//cdn.jsdelivr.net/npm/jutils-src"
]
}
module.exports = {
productionSourceMap: false,
devServer: {
host: '0.0.0.0',
port: 9527,
// 端口
headers: {
'Access-Control-Allow-Origin': '*',
},
hotOnly: false,
disableHostCheck: false
},
lintOnSave: false,
// 取消 eslint 验证
configureWebpack: {
plugins: [new CompressionPlugin({
filename: '[path].gz[query]',
algorithm: "gzip", //brotliCompress
test: /(\.js(\?.*)?)|(\.html(\?.*)?)|(\.css(\?.*)?)$/i,
threshold: 10240,
minRatio: 0.8,
cache:true
})],
externals: {
vue: "Vue",
"element-ui": "ELEMENT",
"vue-router": "VueRouter"
},
},
pages: {
index: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'index.html',
chunks: ['chunk-vendors', 'chunk-common', 'index'],
cdn: cdn
}
},
};