-
Notifications
You must be signed in to change notification settings - Fork 143
/
vue.config.js
31 lines (29 loc) · 953 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
// 配置路径别名
var path = require('path')
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
// 配置基础链接地址,根据发布环境添加 '/preview/bin-admin'
publicPath: process.env.NODE_ENV === 'production'
? './'
: '/',
// dev跨域问题
devServer: {
proxy: {
'/overview': { target: 'http://localhost:8082/' },
'/public': { target: 'http://localhost:8082/' },
'/union': { target: 'http://localhost:8082/' },
'/map': { target: 'http://localhost:8082/' },
'/summary': { target: 'http://localhost:8082/' }
}
},
productionSourceMap: false,
lintOnSave: process.env.NODE_ENV !== 'production',
assetsDir: 'static',
filenameHashing: true, // 发布打包文件是否有哈希后缀
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
}
}