-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathwebpack.prod.js
37 lines (35 loc) · 986 Bytes
/
webpack.prod.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
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const WorkboxPlugin = require('workbox-webpack-plugin');
const LicenseCheckerWebpackPlugin = require('license-checker-webpack-plugin');
module.exports = merge(common, {
mode: 'production',
optimization: {
minimize: true,
splitChunks: {
chunks: 'all'
}
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new WorkboxPlugin.GenerateSW({
clientsClaim: true,
directoryIndex: 'index.html',
navigateFallback: 'index.html',
skipWaiting: true,
swDest: 'sw.js'
}),
new LicenseCheckerWebpackPlugin({
allow: '(Apache-2.0 OR BSD-2-Clause OR 0BSD OR BSD-3-Clause OR MIT)',
ignore: ['@microsoft/*'],
emitError: true,
outputFilename: 'LICENSES.txt'
})
],
performance: {
maxEntrypointSize: 256000,
maxAssetSize: 256000,
hints: 'warning'
}
});