mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
feat(compiler-cli): add support for using TypeScript 4.1 (#39571)
This change enables projects to be built with TypeScript 4.1. Support for TypeScript 4.0 is also retained. PR Close #39571
This commit is contained in:
committed by
Jessica Janiuk
parent
2786292780
commit
a7e7c211b5
@@ -654,7 +654,10 @@ class AngularCompilerProgram implements Program {
|
||||
// - we cache all the files in the hostAdapter
|
||||
// - new new stubs use the exactly same imports/exports as the old once (we assert that in
|
||||
// hostAdapter.updateGeneratedFile).
|
||||
if (tsStructureIsReused(tmpProgram) !== StructureIsReused.Completely) {
|
||||
// TS 4.1+ stores the reuse state in the new program
|
||||
const checkReuseProgram =
|
||||
(ts.versionMajorMinor as string) === '4.0' ? tmpProgram : this._tsProgram;
|
||||
if (tsStructureIsReused(checkReuseProgram) !== StructureIsReused.Completely) {
|
||||
throw new Error(`Internal Error: The structure of the program changed during codegen.`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user