File tree 1 file changed +11
-6
lines changed
packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -279,13 +279,18 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
279
279
comments : false ,
280
280
webkit : true ,
281
281
} ,
282
- compress : {
283
- // PURE comments work best with 3 passes.
284
- // See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
285
- passes : 3 ,
282
+ // On server, we don't want to compress anything. We still set the ngDevMode = false for it
283
+ // to remove dev code, and ngI18nClosureMode to remove Closure compiler i18n code
284
+ compress : ( buildOptions . platform == 'server' ? {
286
285
global_defs : angularGlobalDefinitions ,
287
- } ,
288
- // We want to avoid mangling on server.
286
+ } : {
287
+ pure_getters : buildOptions . buildOptimizer ,
288
+ // PURE comments work best with 3 passes.
289
+ // See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
290
+ passes : buildOptions . buildOptimizer ? 3 : 1 ,
291
+ global_defs : angularGlobalDefinitions ,
292
+ } ) ,
293
+ // We also want to avoid mangling on server.
289
294
...( buildOptions . platform == 'server' ? { mangle : false } : { } ) ,
290
295
} ;
291
296
You can’t perform that action at this time.
0 commit comments