Skip to content

Commit 55893cc

Browse files
committed
refactor(@ngtools/webpack): expose TS Program from ng compiler plugin
Expose the TypeScript Program created by the plugin, so that it can be used in custom platform transformers.
1 parent 1a255e6 commit 55893cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/ngtools/webpack/src/angular_compiler_plugin.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ export class AngularCompilerPlugin {
174174
return { path, className };
175175
}
176176

177+
get typescriptProgram(): ts.Program {
178+
return this._getTsProgram();
179+
}
180+
177181
static isSupported() {
178182
return VERSION && parseInt(VERSION.major) >= 5;
179183
}
@@ -351,7 +355,7 @@ export class AngularCompilerPlugin {
351355
this._updateForkedTypeChecker(this._rootNames, this._getChangedCompilationFiles());
352356
}
353357

354-
// Use an identity function as all our paths are absolute already.
358+
// Use an identity function as all our paths are absolute already.
355359
this._moduleResolutionCache = ts.createModuleResolutionCache(this._basePath, x => x);
356360

357361
if (this._JitMode) {
@@ -1017,7 +1021,7 @@ export class AngularCompilerPlugin {
10171021
.map((resourcePath) => resolve(dirname(resolvedFileName), normalize(resourcePath)));
10181022

10191023
// These paths are meant to be used by the loader so we must denormalize them.
1020-
const uniqueDependencies = new Set([
1024+
const uniqueDependencies = new Set([
10211025
...esImports,
10221026
...resourceImports,
10231027
...this.getResourceDependencies(this._compilerHost.denormalizePath(resolvedFileName)),

0 commit comments

Comments
 (0)