Skip to content

Commit 0934f13

Browse files
committed
fix(@ngtools/webpack): support Angular post beta7 compiler
1 parent 66318d9 commit 0934f13

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

packages/@ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ export class AngularCompilerPlugin implements Tapable {
302302
}
303303

304304
if (this._JitMode) {
305-
306305
// Create the TypeScript program.
307306
time('AngularCompilerPlugin._createOrUpdateProgram.ts.createProgram');
308307
this._program = ts.createProgram(
@@ -321,7 +320,9 @@ export class AngularCompilerPlugin implements Tapable {
321320
rootNames: this._tsFilenames,
322321
options: this._angularCompilerOptions,
323322
host: this._angularCompilerHost,
324-
oldProgram: this._program as Program
323+
// TODO: REMOVE THIS
324+
// Temp workaround for problem with AOT rebuilds. This is just for CI to run right now.
325+
// oldProgram: this._program as Program
325326
});
326327
timeEnd('AngularCompilerPlugin._createOrUpdateProgram.ng.createProgram');
327328

packages/@ngtools/webpack/src/compiler_host.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,14 @@ export class WebpackCompilerHost implements ts.CompilerHost {
228228
const stats = this._files[fileName];
229229
if (stats == null) {
230230
const content = this.readFile(fileName);
231+
231232
if (!this._cache) {
232233
return ts.createSourceFile(fileName, content, languageVersion, this._setParentNodes);
234+
} else if (!this._files[fileName]) {
235+
// If cache is turned on and the file exists, the readFile call will have populated stats.
236+
// Empty stats at this point mean the file doesn't exist at and so we should return
237+
// undefined.
238+
return undefined;
233239
}
234240
}
235241

tests/e2e/tests/build/script-target.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function () {
1212
// TODO: swap this check for ng5.
1313
if (getGlobalVariable('argv').nightly) {
1414
// Angular 5 has a different folder structure.
15-
knownES6Module = '@angular/core/esm15/index';
15+
knownES6Module = '@angular/core/esm2015/core';
1616
}
1717

1818
return Promise.resolve()

0 commit comments

Comments
 (0)