aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/config/webpack.prod.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-27 10:51:26 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-27 10:51:33 +0100
commitf7ac0f84e1135ce893be930da6d935216dac13d3 (patch)
tree13d9358d44c912c8775aec8e8f3d91a7033f34c4 /client/config/webpack.prod.js
parent84c07f8ac19053a219e45e2bf9fd6ec4e46c4d8c (diff)
downloadPeerTube-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.js12
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
12const DefinePlugin = require('webpack/lib/DefinePlugin') 12const DefinePlugin = require('webpack/lib/DefinePlugin')
13const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') 13const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
14const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') 14const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
15const OptimizeJsPlugin = require('optimize-js-plugin')
15const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin') 16const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin')
16const WebpackMd5Hash = require('webpack-md5-hash') 17const 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.