-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathvue.config.js
74 lines (73 loc) · 1.86 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
/*
* +-------------------------------------------+
* | MIITVIP |
* +-------------------------------------------+
* | Copyright (c) 2020 makeit.vip |
* +-------------------------------------------+
* | Author: makeit <[email protected]> |
* | Homepage: https://www.makeit.vip |
* | Github: https://git.makeit.vip |
* | Date: 2020-9-9 13:12 |
* +-------------------------------------------+
*/
const path = require('path');
const resolve = (dir) => path.join(__dirname, dir);
module.exports = {
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
resolve('src/assets/styles/app.less')
]
}
},
runtimeCompiler: true,
productionSourceMap: false,
lintOnSave: false,
parallel: false,
configureWebpack: config => {
config.performance = {
hints: 'warning',
maxEntrypointSize: 51200000,
maxAssetSize: 30000000,
assetFilter: function (assetFilename) {
return assetFilename.endsWith('.js');
}
};
config.entry.app = resolve('src/main.ts');
},
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src'))
.set('@assets', resolve('src/assets'))
.set('@utils', resolve('src/utils'))
.set('@components', resolve('src/components'))
.set('@views', resolve('src/views'))
.set('@styles', resolve('src/assets/styles'))
.set('@images', resolve('src/assets/images'))
.set('@store', resolve('src/store'));
config.module
.rule('worker-loader')
.test('/\\.worker\\.ts$/')
.use('worker-loader')
.loader('worker-loader')
.end();
},
devServer: {
disableHostCheck: true,
proxy: {
'/v1/': {
target: process.env.VUE_APP_PROXY_SERVER,
changeOrigin: true,
pathRewrite: {'^/v1': '/'}
}
}
},
css: {
loaderOptions: {
less: {
javascriptEnabled: true,
}
}
}
}