-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
43 lines (43 loc) · 1.2 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
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ?
'/dist/' : '/',
outputDir: process.env.NODE_ENV === 'production' ?
'/dist/' : '/',
devServer: {
disableHostCheck: true,
proxy: {
'/admin': {
target: "http://127.0.0.1:5000",
changeOrigin: true,
secure: false
}
}
},
chainWebpack: config => {
if (process.env.NODE_ENV === 'production') {
var externals = {
vue: 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
vuex: 'Vuex'
}
config.externals(externals)
const cdn = {
css: [
'https://cdn.bootcdn.net/ajax/libs/element-ui/2.12.0/theme-chalk/index.css'
],
js: [
'https://cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.min.js',
'https://cdn.bootcdn.net/ajax/libs/vue-router/3.1.3/vue-router.min.js',
'https://cdn.bootcdn.net/ajax/libs/vuex/3.1.2/vuex.min.js',
'https://cdn.bootcdn.net/ajax/libs/element-ui/2.12.0/index.js'
]
}
config.plugin('html')
.tap(args => {
args[0].cdn = cdn
return args
})
}
}
}