-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
41 lines (35 loc) · 1.09 KB
/
webpack.prod.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
/* eslint-disable import/no-extraneous-dependencies */
const { merge } = require('webpack-merge');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const WebpackRTLPlugin = require('webpack-rtl-plugin');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
const webpackConfiguration = require('./webpack.config');
module.exports = merge(webpackConfiguration, {
mode: 'production',
/* Manage source maps generation process. Refer to https://webpack.js.org/configuration/devtool/#production */
devtool: false,
/* Optimization configuration */
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
}),
new CssMinimizerPlugin(),
],
},
/* Performance treshold configuration values */
performance: {
maxEntrypointSize: 512000,
maxAssetSize: 512000,
},
/* Additional plugins configuration */
plugins: [
new RemoveEmptyScriptsPlugin(),
new WebpackRTLPlugin({
diffOnly: true,
minify: true,
}),
],
});