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 | |
parent | 84c07f8ac19053a219e45e2bf9fd6ec4e46c4d8c (diff) | |
download | PeerTube-f7ac0f84e1135ce893be930da6d935216dac13d3.tar.gz PeerTube-f7ac0f84e1135ce893be930da6d935216dac13d3.tar.zst PeerTube-f7ac0f84e1135ce893be930da6d935216dac13d3.zip |
Client: add optimize plugin
-rw-r--r-- | client/config/webpack.prod.js | 12 | ||||
-rw-r--r-- | client/package.json | 4 |
2 files changed, 14 insertions, 2 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. |
diff --git a/client/package.json b/client/package.json index f4835590e..1a04be5bc 100644 --- a/client/package.json +++ b/client/package.json | |||
@@ -53,13 +53,14 @@ | |||
53 | "ie-shim": "^0.1.0", | 53 | "ie-shim": "^0.1.0", |
54 | "intl": "^1.2.4", | 54 | "intl": "^1.2.4", |
55 | "json-loader": "^0.5.4", | 55 | "json-loader": "^0.5.4", |
56 | "ng-router-loader": "^1.0.2", | ||
56 | "ng2-bootstrap": "1.1.16-10", | 57 | "ng2-bootstrap": "1.1.16-10", |
57 | "ng2-file-upload": "^1.1.4-2", | 58 | "ng2-file-upload": "^1.1.4-2", |
58 | "ng2-meta": "https://github.com/chocobozzz/ng2-meta#build", | 59 | "ng2-meta": "https://github.com/chocobozzz/ng2-meta#build", |
59 | "ng-router-loader": "^1.0.2", | ||
60 | "ngc-webpack": "1.1.0", | 60 | "ngc-webpack": "1.1.0", |
61 | "node-sass": "^4.1.1", | 61 | "node-sass": "^4.1.1", |
62 | "normalize.css": "^5.0.0", | 62 | "normalize.css": "^5.0.0", |
63 | "optimize-js-plugin": "0.0.4", | ||
63 | "raw-loader": "^0.5.1", | 64 | "raw-loader": "^0.5.1", |
64 | "reflect-metadata": "^0.1.9", | 65 | "reflect-metadata": "^0.1.9", |
65 | "resolve-url-loader": "^1.6.0", | 66 | "resolve-url-loader": "^1.6.0", |
@@ -74,7 +75,6 @@ | |||
74 | "tslint-loader": "^3.3.0", | 75 | "tslint-loader": "^3.3.0", |
75 | "typescript": "~2.1.0", | 76 | "typescript": "~2.1.0", |
76 | "url-loader": "^0.5.7", | 77 | "url-loader": "^0.5.7", |
77 | "v8-lazy-parse-webpack-plugin": "^0.3.0", | ||
78 | "video.js": "^5.11.9", | 78 | "video.js": "^5.11.9", |
79 | "videojs-dock": "^2.0.2", | 79 | "videojs-dock": "^2.0.2", |
80 | "webpack": "2.2.0-rc.3", | 80 | "webpack": "2.2.0-rc.3", |