-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
85 lines (84 loc) · 1.92 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
const { join } = require('path');
const antDesignTheme = require('./config/ant-design-theme');
module.exports = {
chainWebpack: (config) => {
config.module.rules.delete('svg');
},
configureWebpack: {
module: {
rules: [
{
test: /.html$/,
loader: 'vue-template-loader',
exclude: /index.html/,
options: {
transformAssetUrls: {
img: 'src',
},
},
},
{
test: /\.svg$/,
loader: 'vue-svg-loader',
},
],
},
resolve: {
alias: {
vue$: 'vue/dist/vue.common',
ws: join(__dirname, 'node_modules/ws/index.js'), // https://github.com/websockets/ws/issues/1538
},
},
optimization: {
splitChunks: {
chunks: 'async',
minSize: 30000,
maxSize: 0,
minChunks: 1,
maxAsyncRequests: 5,
maxInitialRequests: 3,
automaticNameDelimiter: '~',
automaticNameMaxLength: 30,
name: true,
cacheGroups: {
// Add large packages that aren't required for the initial load here
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all',
priority: 5,
reuseExistingChunk: false,
enforce: true,
},
default: {
minChunks: 2,
name: 'default',
priority: -20,
reuseExistingChunk: true,
},
},
},
},
},
pluginOptions: {
electronBuilder: {
nodeIntegration: true,
builderOptions: {
publish: ['github'],
},
},
},
css: {
loaderOptions: {
less: {
modifyVars: antDesignTheme,
javascriptEnabled: true,
},
},
},
transpileDependencies: ['vuex-module-decorators'],
devServer: {
disableHostCheck: true,
},
productionSourceMap: false,
};