diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-23 22:32:43 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-23 22:32:43 +0100 |
commit | b99290b1d5d736083513fb8f66e91f61bfe07e0b (patch) | |
tree | e0e7fa738ee661a267f5330db35bc46d295f945f /client/config/webpack.common.js | |
parent | 11ac88de40215783835cf6e6259ff0f6cee258dd (diff) | |
download | PeerTube-b99290b1d5d736083513fb8f66e91f61bfe07e0b.tar.gz PeerTube-b99290b1d5d736083513fb8f66e91f61bfe07e0b.tar.zst PeerTube-b99290b1d5d736083513fb8f66e91f61bfe07e0b.zip |
Client: lazy load admin area
Diffstat (limited to 'client/config/webpack.common.js')
-rw-r--r-- | client/config/webpack.common.js | 25 |
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 | ||
7 | const AssetsPlugin = require('assets-webpack-plugin') | 7 | const AssetsPlugin = require('assets-webpack-plugin') |
8 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin | ||
8 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') | 9 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') |
9 | const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') | 10 | const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') |
10 | const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin') | 11 | const 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 | ||