refactor(@ngtools/webpack): expose TS TypeChecker from NG compiler plugin

Expose the TypeScript Program created by the plugin, so that it can be used in custom platform transformers.
This commit is contained in:
vakrilov 2018-08-06 11:37:28 +03:00 committed by Alex Eagle
parent f3e389bd8c
commit 311723d369

View File

@ -174,6 +174,12 @@ export class AngularCompilerPlugin {
return { path, className }; return { path, className };
} }
get typeChecker(): ts.TypeChecker | null {
const tsProgram = this._getTsProgram();
return tsProgram ? tsProgram.getTypeChecker() : null;
}
static isSupported() { static isSupported() {
return VERSION && parseInt(VERSION.major) >= 5; return VERSION && parseInt(VERSION.major) >= 5;
} }