-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
44 lines (44 loc) · 1.15 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
const path = require('path')
const resolve = dir => {
return path.join(__dirname, dir)
}
const BASE_URL = process.env.NODE_ENV === 'production'
? '/'
: '/'
module.exports = {
// 警告 webpack 的性能提示
configureWebpack: {
performance: {
hints: 'warning',
maxEntrypointSize: 50000000,
maxAssetSize: 30000000,
assetFilter: function (assetFilename) {
return assetFilename.endsWith('.js')
}
}
},
publicPath: BASE_URL,
lintOnSave: false,
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src'))
.set('_c', resolve('src/components'))
},
// 打包时不生成.map文件
productionSourceMap: false
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
// devServer: {
// proxy:{
// '/': {
// target: 'http://127.0.0.1:9003',
// secure: false,
// changeOrigin: true,
// pathRewrite: {
// '^/sys': ''
// }
// }
// },
// host: "localhost",
// port: 8080
// }
}