diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 10:51:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 10:51:33 +0100 |
commit | f7ac0f84e1135ce893be930da6d935216dac13d3 (patch) | |
tree | 13d9358d44c912c8775aec8e8f3d91a7033f34c4 /client/config/webpack.prod.js | |
parent | 84c07f8ac19053a219e45e2bf9fd6ec4e46c4d8c (diff) | |
download | PeerTube-f7ac0f84e1135ce893be930da6d935216dac13d3.tar.gz PeerTube-f7ac0f84e1135ce893be930da6d935216dac13d3.tar.zst PeerTube-f7ac0f84e1135ce893be930da6d935216dac13d3.zip |
Client: add optimize plugin
Diffstat (limited to 'client/config/webpack.prod.js')
-rw-r--r-- | client/config/webpack.prod.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/config/webpack.prod.js b/client/config/webpack.prod.js index 51b8a8855..6d65fcb37 100644 --- a/client/config/webpack.prod.js +++ b/client/config/webpack.prod.js | |||
@@ -12,6 +12,7 @@ const commonConfig = require('./webpack.common.js') // the settings that are com | |||
12 | const DefinePlugin = require('webpack/lib/DefinePlugin') | 12 | const DefinePlugin = require('webpack/lib/DefinePlugin') |
13 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') | 13 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') |
14 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') | 14 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') |
15 | const OptimizeJsPlugin = require('optimize-js-plugin') | ||
15 | const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin') | 16 | const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin') |
16 | const WebpackMd5Hash = require('webpack-md5-hash') | 17 | const WebpackMd5Hash = require('webpack-md5-hash') |
17 | 18 | ||
@@ -99,6 +100,17 @@ module.exports = function (env) { | |||
99 | new WebpackMd5Hash(), | 100 | new WebpackMd5Hash(), |
100 | 101 | ||
101 | /** | 102 | /** |
103 | * Webpack plugin to optimize a JavaScript file for faster initial load | ||
104 | * by wrapping eagerly-invoked functions. | ||
105 | * | ||
106 | * See: https://github.com/vigneshshanmugam/optimize-js-plugin | ||
107 | */ | ||
108 | |||
109 | new OptimizeJsPlugin({ | ||
110 | sourceMap: false | ||
111 | }), | ||
112 | |||
113 | /** | ||
102 | * Plugin: DedupePlugin | 114 | * Plugin: DedupePlugin |
103 | * Description: Prevents the inclusion of duplicate code into your bundle | 115 | * Description: Prevents the inclusion of duplicate code into your bundle |
104 | * and instead applies a copy of the function at runtime. | 116 | * and instead applies a copy of the function at runtime. |