-
Notifications
You must be signed in to change notification settings - Fork 460
/
vue.config.js
50 lines (48 loc) · 1.36 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
44
45
46
47
48
49
50
const path = require('path');
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BUILD_PATH: '/',
productionSourceMap: false,
css: {
loaderOptions: {
less: {
modifyVars: {
blue: '#3a82f8',
'text-color': '#333'
},
javascriptEnabled: true
}
}
},
devServer: {
host: process.env.VUE_APP_DEV_HOST || '127.0.0.1',
port: process.env.VUE_APP_DEV_PORT || '8045',
https: false,
hotOnly: false,
proxy: { // 配置跨域
'/api': {
//要访问的跨域的api的域名
target: `${process.env.VUE_APP_API_URL}/`,
ws: true,
changOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
},
configureWebpack: config => {
config.resolve = {
extensions: ['.js', '.vue', '.json', ".css"],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'assets': resolve('src/assets'),
'components': resolve('src/components')
}
}
},
lintOnSave: false
};