-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
41 lines (32 loc) · 1001 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
40
// vue.config.js https://juejin.im/post/5dbeb898e51d456e3153ecf3
const path = require('path');//引入path模块
const fs = require('fs')
function resolve(dir){
return path.join(__dirname,dir)//path.join(__dirname)设置绝对路径
}
// 是否为生产环境
const isProduction = process.env.NODE_ENV !== 'development';
module.exports = {
// 选项...
configureWebpack: config => {
config.devtool = 'source-map';
},
publicPath: "./",
productionSourceMap: false,
devServer: {
proxy: {
'/ghapi': {
target: process.env.VUE_APP_URL+"api",
ws: true,
changeOrigin: true,
},
}
},
chainWebpack:(config)=>{
config.resolve.alias
.set('@',resolve('./src'))
// .set('components',resolve('./src/components'))
//set第一个参数:设置的别名,第二个参数:设置的路径
},
lintOnSave: 'warning',
}