File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
packages/@angular/cli/models Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ export class NgCliWebpackConfig<T extends BuildOptions = BuildOptions> {
95
95
sourcemaps : true ,
96
96
extractCss : false ,
97
97
namedChunks : true ,
98
- aot : false ,
98
+ aot : AngularCompilerPlugin . isSupported ( ) ,
99
99
buildOptimizer : false
100
100
} ,
101
101
production : {
@@ -112,7 +112,7 @@ export class NgCliWebpackConfig<T extends BuildOptions = BuildOptions> {
112
112
113
113
// Use Build Optimizer on prod AOT builds by default when AngularCompilerPlugin is supported.
114
114
const buildOptimizerDefault = {
115
- buildOptimizer : merged . aot && AngularCompilerPlugin . isSupported ( )
115
+ buildOptimizer : buildOptions . target == 'production' && AngularCompilerPlugin . isSupported ( )
116
116
} ;
117
117
118
118
merged = Object . assign ( { } , buildOptimizerDefault , merged ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export default function () {
52
52
. then ( ( ) => replaceInFile ( './src/app/app.module.ts' , / \[ \s * B r o w s e r M o d u l e / g,
53
53
`[BrowserModule.withServerTransition(\{ appId: 'app' \}), ServerModule` ) )
54
54
. then ( ( ) => silentNpm ( 'install' ) )
55
- . then ( ( ) => ng ( 'build' ) )
55
+ . then ( ( ) => ng ( 'build' , '--aot=false' ) )
56
56
// files were created successfully
57
57
. then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' ,
58
58
/ _ _ w e b p a c k _ e x p o r t s _ _ , " A p p M o d u l e " / ) )
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export default function () {
52
52
. then ( ( ) => replaceInFile ( './src/app/app.module.ts' , / \[ \s * B r o w s e r M o d u l e / g,
53
53
`[BrowserModule.withServerTransition(\{ appId: 'app' \}), ServerModule` ) )
54
54
. then ( ( ) => silentNpm ( 'install' ) )
55
- . then ( ( ) => ng ( 'build' ) )
55
+ . then ( ( ) => ng ( 'build' , '--aot=false' ) )
56
56
// files were created successfully
57
57
. then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' ,
58
58
/ _ _ w e b p a c k _ e x p o r t s _ _ , " A p p M o d u l e " / ) )
@@ -101,7 +101,7 @@ export default function () {
101
101
fs.writeFileSync('dist/index.html', html);
102
102
\});
103
103
` ) ) )
104
- . then ( ( ) => ng ( 'build' , '--bundle-dependencies=all' ) )
104
+ . then ( ( ) => ng ( 'build' , '--bundle-dependencies=all' , '--aot=false' ) )
105
105
. then ( ( ) => expectToFail ( ( ) => expectFileToMatch ( './dist/main.bundle.js' ,
106
106
/ r e q u i r e \( [ " ' ] @ a n g u l a r \/ [ ^ " ' ] * [ " ' ] \) / ) ) )
107
107
. then ( ( ) => exec ( normalize ( 'node' ) , 'dist/main.bundle.js' ) ) ;
You can’t perform that action at this time.
0 commit comments