-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
45 lines (45 loc) · 1.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
const config = {
devServer: {
// 前端开发服务器端口号
port: 7001,
// 远程服务代理设置
proxy: {
'^/api': {
// 本地服务地址
target: 'http://localhost:7010',
changeOrigin: true, // 是否跨域
},
},
},
runtimeCompiler: true,
// 生产环境不生成source map(此项关闭可以大幅缩小构架包体积并提高构建速度)
productionSourceMap: false,
publicPath: `/${process.env.VUE_APP_CLIENT_BASE_URL}`,
lintOnSave: true,
pages: {
index: process.env.VUE_APP_ENTRY_PAGE_FILE || 'src/main.js',
},
configureWebpack: {
externals: {
wx: 'jWeixin',
},
devtool: process.env.NODE_ENV === 'production' ? false : 'eval-source-map',
// optimization: {
// runtimeChunk: {
// name: 'manifest',
// },
// splitChunks: {
// chunks: 'initial',
// cacheGroups: {
// vue: {
// priority: 20,
// name: 'vue',
// test: /vue/,
// reuseExistingChunk: true,
// },
// },
// },
// },
},
};
module.exports = config;