Skip to content

Commit 29609fb

Browse files
karaalexeagle
authored andcommitted
Merge pull request #14287 from kara/revert-pure-getters
Revert "fix(@angular-devkit/build-angular): remove pure_getters"
1 parent f189596 commit 29609fb

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

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,18 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
279279
comments: false,
280280
webkit: true,
281281
},
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' ? {
286285
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.
289294
...(buildOptions.platform == 'server' ? { mangle: false } : {}),
290295
};
291296

0 commit comments

Comments
 (0)