1 |
|
2 |
|
3 | /** Production environment specific configurations. */
|
4 | module.exports = () => ({
|
5 | // Fail out on the first error instead of tolerating it.
|
6 | bail: true,
|
7 |
|
8 | // Real source maps for production builds
|
9 | devtool: 'source-map',
|
10 |
|
11 | // Produce warnings about file sizes
|
12 | performance: {
|
13 | hints: 'warning', // 'error' or false are valid too
|
14 | maxEntrypointSize: 500000, // ~500Kb
|
15 | maxAssetSize: 275000, // ~275Kb
|
16 | // Don't warn about image file sizes
|
17 | assetFilter: (assetFilename) => !/\.(map|jpe?g|png|gif|svg)$/i.test(assetFilename),
|
18 | },
|
19 |
|
20 | // Build stats output configuration
|
21 | stats: {
|
22 | // We don't care about the source maps output, exclude them
|
23 | excludeAssets: (assetName) => assetName.includes('.map'),
|
24 | // Suppress the modules output, it doesn't tell us much ¯\_(ツ)_/¯ and adds a
|
25 | // lot of noise to the build stats
|
26 | modules: false,
|
27 | },
|
28 |
|
29 | // Production plugins
|
30 | // ---------------------------------------------------------------------------
|
31 | plugins: [
|
32 | 'namedModulesPlugin',
|
33 | 'cleanPlugin',
|
34 | 'duplicatePackageCheckerPlugin',
|
35 | 'miniCSSExtractPlugin',
|
36 | ],
|
37 | })
|