aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/config/webpack.prod.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/config/webpack.prod.js')
-rw-r--r--client/config/webpack.prod.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/client/config/webpack.prod.js b/client/config/webpack.prod.js
index fc47f03a0..777c816e8 100644
--- a/client/config/webpack.prod.js
+++ b/client/config/webpack.prod.js
@@ -11,6 +11,7 @@ const videoEmbedConfig = require('./webpack.video-embed.js')
11 * Webpack Plugins 11 * Webpack Plugins
12 */ 12 */
13const DefinePlugin = require('webpack/lib/DefinePlugin') 13const DefinePlugin = require('webpack/lib/DefinePlugin')
14const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
14const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') 15const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
15const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') 16const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
16const OptimizeJsPlugin = require('optimize-js-plugin') 17const OptimizeJsPlugin = require('optimize-js-plugin')
@@ -249,6 +250,30 @@ module.exports = function (env) {
249 path: helpers.root('dist') 250 path: helpers.root('dist')
250 } 251 }
251 } 252 }
253 }),
254
255 new BundleAnalyzerPlugin({
256 // Can be `server`, `static` or `disabled`.
257 // In `server` mode analyzer will start HTTP server to show bundle report.
258 // In `static` mode single HTML file with bundle report will be generated.
259 // In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`.
260 analyzerMode: 'static',
261 // Path to bundle report file that will be generated in `static` mode.
262 // Relative to bundles output directory.
263 reportFilename: 'report.html',
264 // Automatically open report in default browser
265 openAnalyzer: false,
266 // If `true`, Webpack Stats JSON file will be generated in bundles output directory
267 generateStatsFile: true,
268 // Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`.
269 // Relative to bundles output directory.
270 statsFilename: 'stats.json',
271 // Options for `stats.toJson()` method.
272 // For example you can exclude sources of your modules from stats file with `source: false` option.
273 // See more options here: https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21
274 statsOptions: null,
275 // Log level. Can be 'info', 'warn', 'error' or 'silent'.
276 logLevel: 'info'
252 }) 277 })
253 ], 278 ],
254 279