forked from gcddblue/vue-admin-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
executable file
·39 lines (38 loc) · 961 Bytes
/
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
const path = require('path')
const resolve = function(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath:
process.env.NODE_ENV === 'production' ? '/vue-admin-webapp/' : '/',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: true, // 是否开启eslint保存检测
productionSourceMap: false, // 是否在构建生产包时生成sourcdeMap
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src'))
.set('views', resolve('src/views'))
config.optimization.runtimeChunk('single')
},
devServer: {
host: 'localhost',
port: '8080',
hot: true,
open: true,
overlay: {
warning: false,
error: true
},
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true,
secure: false,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
}
}
}