mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
feat(compiler-cli): Check unvalidated combination of ngc and TypeScript (#22293)
closes #20669 PR Close #22293
This commit is contained in:
committed by
Victor Berchet
parent
28b23f954c
commit
3ceee99e22
@@ -71,10 +71,11 @@ class AngularCompilerProgram implements Program {
|
||||
rootNames: ReadonlyArray<string>, private options: CompilerOptions,
|
||||
private host: CompilerHost, oldProgram?: Program) {
|
||||
this.rootNames = [...rootNames];
|
||||
const [major, minor] = ts.version.split('.');
|
||||
|
||||
Number(major) > 2 || (Number(major) === 2 && Number(minor) >= 4) ||
|
||||
userError('The Angular Compiler requires TypeScript >= 2.4.');
|
||||
if (ts.version < '2.4.2' || (ts.version >= '2.7.0' && !options.disableTypeScriptVersionCheck)) {
|
||||
throw new Error(
|
||||
`The Angular Compiler requires TypeScript >=2.4.2 and <2.7 but ${ts.version} was found instead.`);
|
||||
}
|
||||
|
||||
this.oldTsProgram = oldProgram ? oldProgram.getTsProgram() : undefined;
|
||||
if (oldProgram) {
|
||||
|
||||
Reference in New Issue
Block a user