From 927e68823b4b196ef105da721bd71e5bc5f33a15 Mon Sep 17 00:00:00 2001 From: Brent Erickson Date: Thu, 24 Dec 2020 09:43:15 -0800 Subject: [PATCH 1/2] Increase incremental build perf Skip attempting to lookup node_modules output files names inside getInputFileNameFromOutput. This should never resolve if the allowTsInNodeModule loader option is not set --- src/servicesHost.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 170d03918..6709fc91e 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -852,6 +852,14 @@ export function makeSolutionBuilderHost( function getInputFileNameFromOutput( outputFileName: string ): string | true | undefined { + // Unless we explicitly want to compile files in node_modules, exclude them from lookups + if ( + !instance.loaderOptions.allowTsInNodeModules && + outputFileName.indexOf('node_modules') !== -1 + ) { + return undefined; + } + const resolvedFileName = filePathKeyMapper(outputFileName); for (const configInfo of configFileInfo.values()) { ensureInputOutputInfo(configInfo); From 5a37b8444951bb690fba13fcbbb93654b76dc079 Mon Sep 17 00:00:00 2001 From: Brent Erickson Date: Tue, 29 Dec 2020 13:11:59 -0800 Subject: [PATCH 2/2] Add forward-slashes around node_modules Co-authored-by: Andrew Branch --- src/servicesHost.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 6709fc91e..774213acb 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -855,7 +855,7 @@ export function makeSolutionBuilderHost( // Unless we explicitly want to compile files in node_modules, exclude them from lookups if ( !instance.loaderOptions.allowTsInNodeModules && - outputFileName.indexOf('node_modules') !== -1 + outputFileName.indexOf('/node_modules/') !== -1 ) { return undefined; }