diff options
Diffstat (limited to 'client/config/webpack.prod.js')
-rw-r--r-- | client/config/webpack.prod.js | 68 |
1 files changed, 57 insertions, 11 deletions
diff --git a/client/config/webpack.prod.js b/client/config/webpack.prod.js index 447d47415..64d776f24 100644 --- a/client/config/webpack.prod.js +++ b/client/config/webpack.prod.js | |||
@@ -9,14 +9,15 @@ const commonConfig = require('./webpack.common.js') // the settings that are com | |||
9 | /** | 9 | /** |
10 | * Webpack Plugins | 10 | * Webpack Plugins |
11 | */ | 11 | */ |
12 | // const ProvidePlugin = require('webpack/lib/ProvidePlugin') | ||
13 | const DefinePlugin = require('webpack/lib/DefinePlugin') | 12 | const DefinePlugin = require('webpack/lib/DefinePlugin') |
14 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') | 13 | const ExtractTextPlugin = require('extract-text-webpack-plugin') |
14 | const IgnorePlugin = require('webpack/lib/IgnorePlugin') | ||
15 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') | 15 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') |
16 | // const IgnorePlugin = require('webpack/lib/IgnorePlugin') | 16 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin') |
17 | // const DedupePlugin = require('webpack/lib/optimize/DedupePlugin') | 17 | const ProvidePlugin = require('webpack/lib/ProvidePlugin') |
18 | const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin') | 18 | const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin') |
19 | const WebpackMd5Hash = require('webpack-md5-hash') | 19 | const WebpackMd5Hash = require('webpack-md5-hash') |
20 | const V8LazyParseWebpackPlugin = require('v8-lazy-parse-webpack-plugin') | ||
20 | 21 | ||
21 | /** | 22 | /** |
22 | * Webpack Constants | 23 | * Webpack Constants |
@@ -154,22 +155,67 @@ module.exports = function (env) { | |||
154 | // comments: true, //debug | 155 | // comments: true, //debug |
155 | 156 | ||
156 | beautify: false, // prod | 157 | beautify: false, // prod |
158 | output: { | ||
159 | comments: false | ||
160 | }, // prod | ||
157 | mangle: { | 161 | mangle: { |
158 | screw_ie8: true, | 162 | screw_ie8: true |
159 | keep_fnames: true | ||
160 | }, // prod | 163 | }, // prod |
161 | compress: { | 164 | compress: { |
162 | screw_ie8: true, | 165 | screw_ie8: true, |
163 | warnings: false | 166 | warnings: false, |
164 | }, // prod | 167 | conditionals: true, |
165 | comments: false // prod | 168 | unused: true, |
169 | comparisons: true, | ||
170 | sequences: true, | ||
171 | dead_code: true, | ||
172 | evaluate: true, | ||
173 | if_return: true, | ||
174 | join_vars: true, | ||
175 | negate_iife: false // we need this for lazy v8 | ||
176 | } | ||
166 | }), | 177 | }), |
167 | 178 | ||
168 | new NormalModuleReplacementPlugin( | 179 | new NormalModuleReplacementPlugin( |
169 | /angular2-hmr/, | 180 | /angular2-hmr/, |
170 | helpers.root('config/modules/angular2-hmr-prod.js') | 181 | helpers.root('config/empty.js') |
171 | ), | 182 | ), |
172 | 183 | ||
184 | new NormalModuleReplacementPlugin( | ||
185 | /zone\.js(\\|\/)dist(\\|\/)long-stack-trace-zone/, | ||
186 | helpers.root('config/empty.js') | ||
187 | ), | ||
188 | |||
189 | // AoT | ||
190 | // new NormalModuleReplacementPlugin( | ||
191 | // /@angular(\\|\/)upgrade/, | ||
192 | // helpers.root('config/empty.js') | ||
193 | // ), | ||
194 | // new NormalModuleReplacementPlugin( | ||
195 | // /@angular(\\|\/)compiler/, | ||
196 | // helpers.root('config/empty.js') | ||
197 | // ), | ||
198 | // new NormalModuleReplacementPlugin( | ||
199 | // /@angular(\\|\/)platform-browser-dynamic/, | ||
200 | // helpers.root('config/empty.js') | ||
201 | // ), | ||
202 | // new NormalModuleReplacementPlugin( | ||
203 | // /dom(\\|\/)debug(\\|\/)ng_probe/, | ||
204 | // helpers.root('config/empty.js') | ||
205 | // ), | ||
206 | // new NormalModuleReplacementPlugin( | ||
207 | // /dom(\\|\/)debug(\\|\/)by/, | ||
208 | // helpers.root('config/empty.js') | ||
209 | // ), | ||
210 | // new NormalModuleReplacementPlugin( | ||
211 | // /src(\\|\/)debug(\\|\/)debug_node/, | ||
212 | // helpers.root('config/empty.js') | ||
213 | // ), | ||
214 | // new NormalModuleReplacementPlugin( | ||
215 | // /src(\\|\/)debug(\\|\/)debug_renderer/, | ||
216 | // helpers.root('config/empty.js') | ||
217 | // ), | ||
218 | |||
173 | /** | 219 | /** |
174 | * Plugin: IgnorePlugin | 220 | * Plugin: IgnorePlugin |
175 | * Description: Don’t generate modules for requests matching the provided RegExp. | 221 | * Description: Don’t generate modules for requests matching the provided RegExp. |
@@ -228,7 +274,7 @@ module.exports = function (env) { | |||
228 | [/\*/, /(?:)/], | 274 | [/\*/, /(?:)/], |
229 | [/\[?\(?/, /(?:)/] | 275 | [/\[?\(?/, /(?:)/] |
230 | ], | 276 | ], |
231 | customAttrAssign: [/\)?]?=/] | 277 | customAttrAssign: [/\)?\]?=/] |
232 | }, | 278 | }, |
233 | 279 | ||
234 | // FIXME: Remove | 280 | // FIXME: Remove |