aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/config
diff options
context:
space:
mode:
Diffstat (limited to 'client/config')
-rw-r--r--client/config/webpack.common.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js
index 223f55c2e..08b8a4b09 100644
--- a/client/config/webpack.common.js
+++ b/client/config/webpack.common.js
@@ -5,6 +5,7 @@ const helpers = require('./helpers')
5 */ 5 */
6 6
7const AssetsPlugin = require('assets-webpack-plugin') 7const AssetsPlugin = require('assets-webpack-plugin')
8const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
8const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') 9const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
9const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') 10const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin')
10const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin') 11const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
@@ -313,6 +314,30 @@ module.exports = function (options) {
313 disabled: !AOT, 314 disabled: !AOT,
314 tsConfig: helpers.root('tsconfig.webpack.json'), 315 tsConfig: helpers.root('tsconfig.webpack.json'),
315 resourceOverride: helpers.root('config/resource-override.js') 316 resourceOverride: helpers.root('config/resource-override.js')
317 }),
318
319 new BundleAnalyzerPlugin({
320 // Can be `server`, `static` or `disabled`.
321 // In `server` mode analyzer will start HTTP server to show bundle report.
322 // In `static` mode single HTML file with bundle report will be generated.
323 // In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`.
324 analyzerMode: 'static',
325 // Path to bundle report file that will be generated in `static` mode.
326 // Relative to bundles output directory.
327 reportFilename: 'report.html',
328 // Automatically open report in default browser
329 openAnalyzer: false,
330 // If `true`, Webpack Stats JSON file will be generated in bundles output directory
331 generateStatsFile: true,
332 // Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`.
333 // Relative to bundles output directory.
334 statsFilename: 'stats.json',
335 // Options for `stats.toJson()` method.
336 // For example you can exclude sources of your modules from stats file with `source: false` option.
337 // See more options here: https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21
338 statsOptions: null,
339 // Log level. Can be 'info', 'warn', 'error' or 'silent'.
340 logLevel: 'info'
316 }) 341 })
317 ], 342 ],
318 343