-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
38 lines (36 loc) · 1.05 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
const path = require('path');
const resolve = dir => {
return path.join(__dirname, dir);
};
module.exports = {
baseUrl: process.env.NODE_ENV === 'production'
? '/production-sub-path/'
: '/',
outputDir: 'dist',
assetsDir: '',
indexPath: 'index.html',
filenameHashing: true,
// true时eslint-loader 会将 lint 错误输出为编译警告,不会编译失败 error:输出错误,编译失败
lintOnSave: 'error',
devServer: {
overlay: {
warnings: true,
errors: true
},
proxy: {
'/api': {
target: 'http://localhost:9999',
secure: false,
changeOrigin: true
// pathRewrite: {'^/api': ''},
}
}
},
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'));
},
// 打包时不生成.map文件,如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false
};