-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·44 lines (37 loc) · 1.02 KB
/
webpack.config.js
File metadata and controls
executable file
·44 lines (37 loc) · 1.02 KB
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
/* eslint-disable import/no-extraneous-dependencies */
const { merge } = require('webpack-merge');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const common = require('./webpack.common');
module.exports = merge(common,{
mode: 'production',
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: 'public/manifest.json', to: '' },
{ from: 'public/service-worker.js', to: '' },
{ from: 'public/icon.png', to: 'assets' },
],
}),
],
optimization: {
minimize: true,
minimizer: [new CssMinimizerPlugin(), new TerserPlugin()],
runtimeChunk: 'single',
splitChunks: {
chunks: 'async',
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
},
},
},
},
performance: {
maxEntrypointSize: 512000,
maxAssetSize: 512000,
},
});