-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvue.config.js
61 lines (53 loc) · 1.27 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
const { defineConfig } = require('@vue/cli-service');
const Version = new Date().getTime();
const isPro = process.env.NODE_ENV === 'production';
module.exports = defineConfig({
transpileDependencies: true,
devServer:{
port:9070,
proxy: {
'/api': {
target: 'http://192.168.1.143:9090',
//target: 'http://192.168.1.169:9090',
ws: true,
withCredentials:true,
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
},
chainWebpack: config => {
if (isPro) {
config.plugin('extract-css').tap((args) => [
{
filename: `css/[name].${Version}.css`,
chunkFilename: `css/[name].${Version}.css`,
},
])
}
config.module
.rule('worker')
.test(/\.worker\.js$/)
.use('worker-loader')
.loader('worker-loader')
.options({
inline: 'fallback'
})
//config.output.globalObject('this')
//config.optimization.delete('splitChunks')
},
parallel: false,
publicPath: '/',
configureWebpack: {
output: {
filename: `js/[name].${Version}.js`,
chunkFilename: `js/[name].${Version}.js`,
},
//devtool: 'source-map',
performance:{
maxAssetSize: 30000000,
}
},
})