forked from Duet3D/DuetWebControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
66 lines (65 loc) · 1.63 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
const CustomImportsPlugin = require('./webpack/lib/custom-imports-plugin.js')
const CompressionPlugin = require('compression-webpack-plugin')
const ZipPlugin = require('zip-webpack-plugin')
module.exports = {
configureWebpack: {
devtool: 'source-map',
externals: {
moment: 'moment'
},
optimization: {
chunkIds: 'named',
concatenateModules: false,
flagIncludedChunks: false,
mergeDuplicateChunks: false,
moduleIds: 'named',
occurrenceOrder: false,
removeAvailableModules: false,
usedExports: false
},
performance: { hints: false },
plugins: (process.env.NODE_ENV === 'production') ? [
new CustomImportsPlugin(),
new CompressionPlugin({
minRatio: Infinity
}),
...((process.env.NOZIP) ? [] : [
new ZipPlugin({
filename: 'DuetWebControl-SD.zip',
include: [/\.gz$/, /\.woff$/, /\.woff2$/],
exclude: [/DummyPlugin/, 'robots.txt']
}),
new ZipPlugin({
filename: 'DuetWebControl-SBC.zip',
exclude: [/\.gz$/, /\.zip$/, /DummyPlugin/]
})
])
] : []
},
chainWebpack: config => {
config.optimization.minimizer('terser').tap(args => {
const { terserOptions } = args[0]
terserOptions.keep_classnames = true;
terserOptions.keep_fnames = true;
return args;
});
config.optimization.set('splitChunks', {
chunks: 'all',
cacheGroups: {
default: false,
vendors: false
}
});
config.plugins.delete('prefetch');
config.plugins.delete('hash-module-ids');
},
pwa: {
name: 'Duet Web Control',
themeColor: '#2196f3',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black'
},
transpileDependencies: [
'vuetify'
]
}