-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvue.config.js
49 lines (47 loc) · 1.43 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
const path = require('path')
const resolve = dir => {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: './',
outputDir: 'web',
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
.set('_conf', resolve('config'))
},
// 打包时不生成.map文件
productionSourceMap: true,
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
// devServer: {
// port: 80,
// proxy: {
// '/mmbiz_*/*': {
// // target: 'http://localhost:3000/',
// target: 'http://mmbiz.qpic.cn/',
// changeOrigin: true,
// ws: true
// },
// '/apin/*': {
// target: 'http://swoft-test.knowyourself.cc:11620/',
// // target: 'http://localhost:3000/',
// pathRewrite:{
// '^/apin':'/'
// },
// changeOrigin: true,
// ws: true
// },
// '/api/activity/*': {
// target: 'http://api-test.knowyourself.cc/wechat_activity/activity',
// // target: 'http://localhost:3000/activity',
// pathRewrite: {
// '^/api/activity/': '/'
// },
// changeOrigin: true,
// ws: true
// },
// },
// disableHostCheck: true
// },
}