From 76792716fe59551db0339ecbbf96315e2a92355b Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 25 Mar 2020 12:29:45 +0100 Subject: [PATCH] fix(@ngtools/webpack): provide tsconfig path to ngcc --- packages/ngtools/webpack/src/angular_compiler_plugin.ts | 1 + packages/ngtools/webpack/src/ngcc_processor.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index 25524a995798..34183aef5136 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -776,6 +776,7 @@ export class AngularCompilerPlugin { this._errors, this._basePath, this._compilerOptions, + this._tsConfigPath, ); ngccProcessor.process(); diff --git a/packages/ngtools/webpack/src/ngcc_processor.ts b/packages/ngtools/webpack/src/ngcc_processor.ts index 642285f83412..93abb697eeb1 100644 --- a/packages/ngtools/webpack/src/ngcc_processor.ts +++ b/packages/ngtools/webpack/src/ngcc_processor.ts @@ -37,6 +37,7 @@ export class NgccProcessor { private readonly compilationErrors: (Error | string)[], private readonly basePath: string, private readonly compilerOptions: ts.CompilerOptions, + private readonly tsConfigPath: string, ) { this._logger = new NgccLogger(this.compilationWarnings, this.compilationErrors); this._nodeModulesDirectory = this.findNodeModulesDirectory(this.basePath); @@ -82,6 +83,8 @@ export class NgccProcessor { '--first-only', /** compileAllFormats */ '--create-ivy-entry-points', /** createNewEntryPointFormats */ '--async', + '--tsconfig', /** tsConfigPath */ + this.tsConfigPath, ], { stdio: ['inherit', process.stderr, process.stderr], @@ -127,7 +130,10 @@ export class NgccProcessor { compileAllFormats: false, createNewEntryPointFormats: true, logger: this._logger, + // Path mappings are not longer required since NGCC 9.1 + // We keep using them to be backward compatible with NGCC 9.0 pathMappings: this._pathMappings, + tsConfigPath: this.tsConfigPath, }); timeEnd(timeLabel);