-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathvue.config.js
89 lines (86 loc) · 2.12 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://127.0.0.1:9001',
changeOrigin: true,
// secure: false,
pathRewrite: {
'^/api': ''
}
},
'/serverApi': {
target: 'http://127.0.0.1:9002/',
changeOrigin: true,
// secure: false,
pathRewrite: {
'^/serverApi': ''
}
},
'/extension': {
target: 'http://ip:9003',
changeOrigin: true,
// secure: false,
pathRewrite: {
'^/extension': ''
}
},
'/music': {
target: 'https://www.autumnfish.cn/',
changeOrigin: true,
// secure: false,
pathRewrite: {
'^/music': ''
}
},
'/dl': {
target: 'http://127.0.0.1:9005',
changeOrigin: true,
// secure: false,
pathRewrite: {
'^/dl': ''
}
},
'/ai': {
target: 'http://127.0.0.1:9007',
changeOrigin: true,
// secure: false,
pathRewrite: {
'^/ai': ''
}
}
},
before: app => {}
},
chainWebpack: config => {
// 发布模式
config.when(process.env.NODE_ENV === 'production', config => {
// 默认是main.js要清空换成自己的
config.entry('app').clear().add('./src/main-prod.js')
config.set('externals', {
// vue: 'Vue',
'vue-router': 'VueRouter',
axios: 'axios',
lodash: '_',
echarts: 'echarts',
nprogress: 'NProgress'
// 'mavon-editor': 'mavon-editor' // 配置有问题,不知道如何修改
})
config.plugin('html').tap(args => {
args[0].isProd = true
args[0].title = 'Tcefrep的博客'
return args
})
})
// 开发模式
config.when(process.env.NODE_ENV === 'development', config => {
// 默认是main.js要清空换成自己的
config.entry('app').clear().add('./src/main-dev.js')
config.plugin('html').tap(args => {
args[0].isProd = false
args[0].title = 'Tcefrep的博客'
return args
})
})
}
}