-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvue.config.js
39 lines (39 loc) · 1.07 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
module.exports = {
// outputDir: process.env.outputDir,
// assetsDir: 'static',
devServer: {
open: false,
host: 'localhost',
port: 3100,
https: false,
hotOnly: false,
proxy: {
'/': {
ws: false,
target: 'https://xxx.com/',// 设置你调用的接口域名和端口号 别忘了加http, 比如:http://40.00.100.100:3002/
changeOrigin: true,
pathRewrite: {
'^/': ''// 这里理解成用‘/’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/user/add’即可
}
},
}
},
productionSourceMap: false,
// chainWebpack: config => {
// config.module
// .rule('svg')
// .uses.clear()
// config.module
// .rule('svg1')
// .test(/\.svg$/)
// .use('svg-sprite')
// .loader('svg-sprite-loader')
// .options({
// symbolId: 'icon-[name]'
// })
// .end()
// .include
// .add(resolve('src/icons'))
// .end()
// },
}