diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-09-14 22:16:39 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-09-14 22:16:39 +0200 |
commit | 3523b64a03d677c2f8df61c121ff4fcb1d9db7f9 (patch) | |
tree | 37bfd6c76f02f2707b71b21a4e69ca3d212a26a0 /client/config | |
parent | bfb3a98fac582f104c6d9b8b7242ea2cbb650b91 (diff) | |
download | PeerTube-3523b64a03d677c2f8df61c121ff4fcb1d9db7f9.tar.gz PeerTube-3523b64a03d677c2f8df61c121ff4fcb1d9db7f9.tar.zst PeerTube-3523b64a03d677c2f8df61c121ff4fcb1d9db7f9.zip |
Optimize imports
Diffstat (limited to 'client/config')
-rw-r--r-- | client/config/webpack.common.js | 25 | ||||
-rw-r--r-- | client/config/webpack.dev.js | 22 | ||||
-rw-r--r-- | client/config/webpack.prod.js | 25 |
3 files changed, 25 insertions, 47 deletions
diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js index 7392c58d3..000699aa5 100644 --- a/client/config/webpack.common.js +++ b/client/config/webpack.common.js | |||
@@ -5,7 +5,6 @@ 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 | ||
9 | const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') | 8 | const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') |
10 | const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin') | 9 | const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin') |
11 | const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin | 10 | const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin |
@@ -297,30 +296,6 @@ module.exports = function (options) { | |||
297 | new ngcWebpack.NgcWebpackPlugin({ | 296 | new ngcWebpack.NgcWebpackPlugin({ |
298 | disabled: !AOT, | 297 | disabled: !AOT, |
299 | tsConfig: helpers.root('tsconfig.webpack.json') | 298 | tsConfig: helpers.root('tsconfig.webpack.json') |
300 | }), | ||
301 | |||
302 | new BundleAnalyzerPlugin({ | ||
303 | // Can be `server`, `static` or `disabled`. | ||
304 | // In `server` mode analyzer will start HTTP server to show bundle report. | ||
305 | // In `static` mode single HTML file with bundle report will be generated. | ||
306 | // In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`. | ||
307 | analyzerMode: 'static', | ||
308 | // Path to bundle report file that will be generated in `static` mode. | ||
309 | // Relative to bundles output directory. | ||
310 | reportFilename: 'report.html', | ||
311 | // Automatically open report in default browser | ||
312 | openAnalyzer: false, | ||
313 | // If `true`, Webpack Stats JSON file will be generated in bundles output directory | ||
314 | generateStatsFile: true, | ||
315 | // Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`. | ||
316 | // Relative to bundles output directory. | ||
317 | statsFilename: 'stats.json', | ||
318 | // Options for `stats.toJson()` method. | ||
319 | // For example you can exclude sources of your modules from stats file with `source: false` option. | ||
320 | // See more options here: https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21 | ||
321 | statsOptions: null, | ||
322 | // Log level. Can be 'info', 'warn', 'error' or 'silent'. | ||
323 | logLevel: 'info' | ||
324 | }) | 299 | }) |
325 | ], | 300 | ], |
326 | 301 | ||
diff --git a/client/config/webpack.dev.js b/client/config/webpack.dev.js index 8948af9b2..d825f40e0 100644 --- a/client/config/webpack.dev.js +++ b/client/config/webpack.dev.js | |||
@@ -91,28 +91,6 @@ module.exports = function (env) { | |||
91 | libraryTarget: 'var' | 91 | libraryTarget: 'var' |
92 | }, | 92 | }, |
93 | 93 | ||
94 | module: { | ||
95 | |||
96 | // Too slow, life is short | ||
97 | // rules: [ | ||
98 | // { | ||
99 | // test: /\.ts$/, | ||
100 | // use: [ | ||
101 | // { | ||
102 | // loader: 'tslint-loader', | ||
103 | // options: { | ||
104 | // configFile: 'tslint.json' | ||
105 | // } | ||
106 | // } | ||
107 | // ], | ||
108 | // exclude: [ | ||
109 | // /\.(spec|e2e)\.ts$/, | ||
110 | // /node_modules\// | ||
111 | // ] | ||
112 | // } | ||
113 | // ] | ||
114 | }, | ||
115 | |||
116 | plugins: [ | 94 | plugins: [ |
117 | 95 | ||
118 | /** | 96 | /** |
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 | */ |
13 | const DefinePlugin = require('webpack/lib/DefinePlugin') | 13 | const DefinePlugin = require('webpack/lib/DefinePlugin') |
14 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin | ||
14 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') | 15 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') |
15 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') | 16 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') |
16 | const OptimizeJsPlugin = require('optimize-js-plugin') | 17 | const 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 | ||