Skip to content

Commit cde0219

Browse files
committed
feat(@angular/cli): aot by default
1 parent 450383c commit cde0219

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/@angular/cli/models/webpack-config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class NgCliWebpackConfig<T extends BuildOptions = BuildOptions> {
9595
sourcemaps: true,
9696
extractCss: false,
9797
namedChunks: true,
98-
aot: false,
98+
aot: AngularCompilerPlugin.isSupported(),
9999
buildOptimizer: false
100100
},
101101
production: {
@@ -112,7 +112,7 @@ export class NgCliWebpackConfig<T extends BuildOptions = BuildOptions> {
112112

113113
// Use Build Optimizer on prod AOT builds by default when AngularCompilerPlugin is supported.
114114
const buildOptimizerDefault = {
115-
buildOptimizer: merged.aot && AngularCompilerPlugin.isSupported()
115+
buildOptimizer: buildOptions.target == 'production' && AngularCompilerPlugin.isSupported()
116116
};
117117

118118
merged = Object.assign({}, buildOptimizerDefault, merged);

tests/e2e/tests/build/platform-server-lazy-module-map.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function () {
5252
.then(() => replaceInFile('./src/app/app.module.ts', /\[\s*BrowserModule/g,
5353
`[BrowserModule.withServerTransition(\{ appId: 'app' \}), ServerModule`))
5454
.then(() => silentNpm('install'))
55-
.then(() => ng('build'))
55+
.then(() => ng('build', '--aot=false'))
5656
// files were created successfully
5757
.then(() => expectFileToMatch('dist/main.bundle.js',
5858
/__webpack_exports__, "AppModule"/))

tests/e2e/tests/build/platform-server.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function () {
5252
.then(() => replaceInFile('./src/app/app.module.ts', /\[\s*BrowserModule/g,
5353
`[BrowserModule.withServerTransition(\{ appId: 'app' \}), ServerModule`))
5454
.then(() => silentNpm('install'))
55-
.then(() => ng('build'))
55+
.then(() => ng('build', '--aot=false'))
5656
// files were created successfully
5757
.then(() => expectFileToMatch('dist/main.bundle.js',
5858
/__webpack_exports__, "AppModule"/))
@@ -101,7 +101,7 @@ export default function () {
101101
fs.writeFileSync('dist/index.html', html);
102102
\});
103103
`)))
104-
.then(() => ng('build', '--bundle-dependencies=all'))
104+
.then(() => ng('build', '--bundle-dependencies=all', '--aot=false'))
105105
.then(() => expectToFail(() => expectFileToMatch('./dist/main.bundle.js',
106106
/require\(["']@angular\/[^"']*["']\)/)))
107107
.then(() => exec(normalize('node'), 'dist/main.bundle.js'));

0 commit comments

Comments
 (0)