File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,23 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
308308 // Do nothing, the default above will be used instead.
309309 }
310310
311+ if ( buildOptions . aot ) {
312+ // Also try to load AOT-only global definitions.
313+ try {
314+ // tslint:disable-next-line:no-implicit-dependencies
315+ const GLOBAL_DEFS_FOR_TERSER_WITH_AOT =
316+ require ( '@angular/compiler-cli' ) . GLOBAL_DEFS_FOR_TERSER_WITH_AOT ;
317+ if ( GLOBAL_DEFS_FOR_TERSER_WITH_AOT ) {
318+ angularGlobalDefinitions = {
319+ ...angularGlobalDefinitions ,
320+ ...GLOBAL_DEFS_FOR_TERSER_WITH_AOT ,
321+ } ;
322+ }
323+ } catch {
324+ // Do nothing.
325+ }
326+ }
327+
311328 const terserOptions = {
312329 ecma : wco . supportES2015 ? 6 : 5 ,
313330 warnings : ! ! buildOptions . verbose ,
You can’t perform that action at this time.
0 commit comments