-
Notifications
You must be signed in to change notification settings - Fork 52
/
vue.config.js
43 lines (37 loc) · 955 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
41
42
43
const path = require('path')
// const webpack = require('webpack');
function resolve (dir) {
return path.join(__dirname, dir)
}
// vue.config.js
module.exports = {
publicPath: '/',
transpileDependencies: ['resize-detector', 'ant-design-vue'],
// configureWebpack: {
// plugins: [
// // Ignore all locale files of moment.js
// new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
// ]
// },
chainWebpack: config => {
config.resolve.alias
.set('public', resolve('public'))
.set('@', resolve('src'))
.set('@api', resolve('src/api'))
.set('@assets', resolve('src/assets'))
.set('@comp', resolve('src/components'))
.set('@views', resolve('src/views'))
},
devServer: {
proxy: {
'/api': {
target: 'http://localhost:3000', // 后端服务器
ws: false,
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
}
}