From 5b1e7ece497141bac4a986ac50b08db3e82ae9b7 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 9 Apr 2021 16:36:35 -0700 Subject: [PATCH 01/11] ClearCache for watchHost --- src/interfaces.ts | 5 +++-- src/servicesHost.ts | 2 +- src/watch-run.ts | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index f2bf5a4b5..6c2cdb385 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -102,8 +102,9 @@ export interface ServiceHostWhichMayBeCacheable export interface WatchHost extends typescript.WatchCompilerHostOfFilesAndCompilerOptions< - typescript.EmitAndSemanticDiagnosticsBuilderProgram - > { + typescript.EmitAndSemanticDiagnosticsBuilderProgram + >, + HostMayBeCacheable { invokeFileWatcher: WatchFactory['invokeFileWatcher']; updateRootFileNames(): void; outputFiles: Map; diff --git a/src/servicesHost.ts b/src/servicesHost.ts index d44dce8b7..5d3598ce8 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -493,7 +493,7 @@ export function makeWatchHost( fileName => files.has(filePathKeyMapper(fileName)) || compiler.sys.fileExists(fileName), - /*enabledCaching*/ false + instance.loaderOptions.experimentalFileCaching ); const watchHost: WatchHost = { diff --git a/src/watch-run.ts b/src/watch-run.ts index 69b9e0c6d..281c09276 100644 --- a/src/watch-run.ts +++ b/src/watch-run.ts @@ -22,6 +22,7 @@ export function makeWatchRun( return (compiler: webpack.Compiler, callback: (err?: Error) => void) => { instance.servicesHost?.clearCache?.(); + instance.watchHost?.clearCache?.(); const promises = []; if (instance.loaderOptions.transpileOnly) { instance.reportTranspileErrors = true; From 76c7a93b1473e646eb6c14c06f0e2a20bf1c9ee8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 15 Apr 2021 10:58:33 -0700 Subject: [PATCH 02/11] Use module resolution cache --- src/interfaces.ts | 29 +++++++++++ src/servicesHost.ts | 119 ++++++++++++++++++++++++++++++++++++++------ src/watch-run.ts | 1 + 3 files changed, 133 insertions(+), 16 deletions(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index 6c2cdb385..56dc63224 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -179,6 +179,34 @@ export interface ConfigFileInfo { dtsFiles?: string[]; } +interface CacheWithRedirects { + ownMap: Map; + redirectsMap: Map>; + getOrCreateMapOfCacheRedirects( + redirectedReference: typescript.ResolvedProjectReference | undefined + ): Map; + clear(): void; + setOwnOptions(newOptions: typescript.CompilerOptions): void; + setOwnMap(newOwnMap: Map): void; +} +interface PerModuleNameCache { + get( + directory: string + ): typescript.ResolvedModuleWithFailedLookupLocations | undefined; + set( + directory: string, + result: typescript.ResolvedModuleWithFailedLookupLocations + ): void; +} +export interface ModuleResolutionCache + extends typescript.ModuleResolutionCache { + directoryToModuleNameMap: CacheWithRedirects< + Map + >; + moduleNameToDirectoryMap: CacheWithRedirects; + clear(): void; + update(compilerOptions: typescript.CompilerOptions): void; +} export interface TSInstance { compiler: typeof typescript; compilerOptions: typescript.CompilerOptions; @@ -186,6 +214,7 @@ export interface TSInstance { appendTsTsxSuffixesIfRequired: (filePath: string) => string; loaderOptions: LoaderOptions; rootFileNames: Set; + moduleResolutionCache?: ModuleResolutionCache; /** * a cache of all the files */ diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 5d3598ce8..1ea6add13 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -10,6 +10,7 @@ import { CustomResolveModuleName, CustomResolveTypeReferenceDirective, FilePathKey, + ModuleResolutionCache, ModuleResolutionHostMayBeCacheable, ResolvedModule, ResolveSync, @@ -273,14 +274,15 @@ function makeResolvers( compiler, compilerOptions, moduleResolutionHost, - customResolveModuleName + customResolveModuleName, + instance ); const resolveModuleNames = ( moduleNames: string[], containingFile: string, _reusedNames?: string[] | undefined, - _redirectedReference?: typescript.ResolvedProjectReference | undefined + redirectedReference?: typescript.ResolvedProjectReference | undefined ): (typescript.ResolvedModule | undefined)[] => { const resolvedModules = moduleNames.map(moduleName => resolveModule( @@ -289,7 +291,8 @@ function makeResolvers( appendTsTsxSuffixesIfRequired, scriptRegex, moduleName, - containingFile + containingFile, + redirectedReference ) ); @@ -601,6 +604,60 @@ export function makeWatchHost( const missingFileModifiedTime = new Date(0); +function identity(x: T) { + return x; +} +function toLowerCase(x: string) { + return x.toLowerCase(); +} +const fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g; +function toFileNameLowerCase(x: string) { + return fileNameLowerCaseRegExp.test(x) + ? x.replace(fileNameLowerCaseRegExp, toLowerCase) + : x; +} +function createGetCanonicalFileName(instance: TSInstance) { + return useCaseSensitiveFileNames(instance.compiler, instance.loaderOptions) + ? identity + : toFileNameLowerCase; +} + +function createModuleResolutionCache( + instance: TSInstance, + moduleResolutionHost: typescript.ModuleResolutionHost +): ModuleResolutionCache { + const cache = instance.compiler.createModuleResolutionCache( + moduleResolutionHost.getCurrentDirectory!(), + createGetCanonicalFileName(instance), + instance.compilerOptions + ) as ModuleResolutionCache; + // Add new API optional methods + if (!cache.clear) { + cache.clear = () => { + cache.directoryToModuleNameMap.clear(); + cache.moduleNameToDirectoryMap.clear(); + }; + } + if (!cache.update) { + cache.update = options => { + if (!options.configFile) return; + const ref: typescript.ResolvedProjectReference = { + sourceFile: options.configFile! as typescript.TsConfigSourceFile, + commandLine: { options } as typescript.ParsedCommandLine, + }; + cache.directoryToModuleNameMap.setOwnMap( + cache.directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref) + ); + cache.moduleNameToDirectoryMap.setOwnMap( + cache.moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref) + ); + cache.directoryToModuleNameMap.setOwnOptions(options); + cache.moduleNameToDirectoryMap.setOwnOptions(options); + }; + } + return cache; +} + /** * Create the TypeScript Watch host */ @@ -618,12 +675,7 @@ export function makeSolutionBuilderHost( // loader.context seems to work fine on Linux / Mac regardless causes problems for @types resolution on Windows for TypeScript < 2.3 const formatDiagnosticHost: typescript.FormatDiagnosticsHost = { getCurrentDirectory: compiler.sys.getCurrentDirectory, - getCanonicalFileName: useCaseSensitiveFileNames( - compiler, - instance.loaderOptions - ) - ? s => s - : s => s.toLowerCase(), + getCanonicalFileName: createGetCanonicalFileName(instance), getNewLine: () => compiler.sys.newLine, }; @@ -706,6 +758,26 @@ export function makeSolutionBuilderHost( const solutionBuilderHost: SolutionBuilderWithWatchHost = { ...sysHost, ...moduleResolutionHost, + createProgram: ( + rootNames, + options, + host, + oldProgram, + configFileParsingDiagnostics, + projectReferences + ) => { + instance.moduleResolutionCache?.update(options || {}); + const result = sysHost.createProgram( + rootNames, + options, + host, + oldProgram, + configFileParsingDiagnostics, + projectReferences + ); + instance.moduleResolutionCache?.update(instance.compilerOptions); + return result; + }, resolveModuleNames, resolveTypeReferenceDirectives, diagnostics, @@ -1131,7 +1203,8 @@ function resolveModule( appendTsTsxSuffixesIfRequired: (filePath: string) => string, scriptRegex: RegExp, moduleName: string, - containingFile: string + containingFile: string, + redirectedReference: typescript.ResolvedProjectReference | undefined ) { let resolutionResult: ResolvedModule; @@ -1149,7 +1222,11 @@ function resolveModule( } } catch (e) {} - const tsResolution = resolveModuleName(moduleName, containingFile); + const tsResolution = resolveModuleName( + moduleName, + containingFile, + redirectedReference + ); if (tsResolution.resolvedModule !== undefined) { const resolvedFileName = path.normalize( tsResolution.resolvedModule.resolvedFileName @@ -1173,26 +1250,36 @@ function resolveModule( type ResolveModuleName = ( moduleName: string, - containingFile: string + containingFile: string, + redirectedReference: typescript.ResolvedProjectReference | undefined ) => typescript.ResolvedModuleWithFailedLookupLocations; function makeResolveModuleName( compiler: typeof typescript, compilerOptions: typescript.CompilerOptions, moduleResolutionHost: typescript.ModuleResolutionHost, - customResolveModuleName: CustomResolveModuleName | undefined + customResolveModuleName: CustomResolveModuleName | undefined, + instance: TSInstance ): ResolveModuleName { if (customResolveModuleName === undefined) { - return (moduleName: string, containingFile: string) => + if (!instance.moduleResolutionCache) { + instance.moduleResolutionCache = createModuleResolutionCache( + instance, + moduleResolutionHost + ); + } + return (moduleName, containingFile, redirectedReference) => compiler.resolveModuleName( moduleName, containingFile, compilerOptions, - moduleResolutionHost + moduleResolutionHost, + instance.moduleResolutionCache, + redirectedReference ); } - return (moduleName: string, containingFile: string) => + return (moduleName, containingFile) => customResolveModuleName( moduleName, containingFile, diff --git a/src/watch-run.ts b/src/watch-run.ts index 281c09276..c2165a6c4 100644 --- a/src/watch-run.ts +++ b/src/watch-run.ts @@ -23,6 +23,7 @@ export function makeWatchRun( return (compiler: webpack.Compiler, callback: (err?: Error) => void) => { instance.servicesHost?.clearCache?.(); instance.watchHost?.clearCache?.(); + instance.moduleResolutionCache?.clear(); const promises = []; if (instance.loaderOptions.transpileOnly) { instance.reportTranspileErrors = true; From f55dd9fcf91c7ac2bc6d9ee836bf70d1cb8847a8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 15 Apr 2021 17:32:05 -0700 Subject: [PATCH 03/11] Use complete ResolvedModuleFull from typescript --- src/servicesHost.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 1ea6add13..52f76ca63 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -1232,10 +1232,9 @@ function resolveModule( tsResolution.resolvedModule.resolvedFileName ); const tsResolutionResult: ResolvedModule = { + ...tsResolution.resolvedModule, originalFileName: resolvedFileName, resolvedFileName, - isExternalLibraryImport: - tsResolution.resolvedModule.isExternalLibraryImport, }; return resolutionResult! === undefined || From 28a903dbd60448ebe188d78a829c3cc2132eee74 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 19 Apr 2021 18:12:20 -0700 Subject: [PATCH 04/11] Use type reference directive cache so that results are atomic like module resolution till watch is invoked --- src/interfaces.ts | 14 ++++++++++ src/servicesHost.ts | 66 ++++++++++++++++++++++++++++----------------- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index 56dc63224..e568a954f 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -206,6 +206,19 @@ export interface ModuleResolutionCache moduleNameToDirectoryMap: CacheWithRedirects; clear(): void; update(compilerOptions: typescript.CompilerOptions): void; + getPackageJsonInfoCache?(): any; +} +// Till api is updated +export interface TypeReferenceDirectiveResolutionCache { + getOrCreateCacheForDirectory( + directoryName: string, + redirectedReference?: typescript.ResolvedProjectReference + ): Map< + string, + typescript.ResolvedTypeReferenceDirectiveWithFailedLookupLocations + >; + clear(): void; + update(compilerOptions: typescript.CompilerOptions): void; } export interface TSInstance { compiler: typeof typescript; @@ -215,6 +228,7 @@ export interface TSInstance { loaderOptions: LoaderOptions; rootFileNames: Set; moduleResolutionCache?: ModuleResolutionCache; + typeReferenceResolutionCache?: TypeReferenceDirectiveResolutionCache; /** * a cache of all the files */ diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 52f76ca63..2cfca1360 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -249,27 +249,6 @@ function makeResolvers( scriptRegex: RegExp, instance: TSInstance ) { - const resolveTypeReferenceDirective = makeResolveTypeReferenceDirective( - compiler, - compilerOptions, - moduleResolutionHost, - customResolveTypeReferenceDirective - ); - - const resolveTypeReferenceDirectives = ( - typeDirectiveNames: string[], - containingFile: string, - _redirectedReference?: typescript.ResolvedProjectReference - ): (typescript.ResolvedTypeReferenceDirective | undefined)[] => - typeDirectiveNames.map( - directive => - resolveTypeReferenceDirective( - directive, - containingFile, - _redirectedReference - ).resolvedTypeReferenceDirective - ); - const resolveModuleName = makeResolveModuleName( compiler, compilerOptions, @@ -301,6 +280,28 @@ function makeResolvers( return resolvedModules; }; + const resolveTypeReferenceDirective = makeResolveTypeReferenceDirective( + compiler, + compilerOptions, + moduleResolutionHost, + customResolveTypeReferenceDirective, + instance + ); + + const resolveTypeReferenceDirectives = ( + typeDirectiveNames: string[], + containingFile: string, + _redirectedReference?: typescript.ResolvedProjectReference + ): (typescript.ResolvedTypeReferenceDirective | undefined)[] => + typeDirectiveNames.map( + directive => + resolveTypeReferenceDirective( + directive, + containingFile, + _redirectedReference + ).resolvedTypeReferenceDirective + ); + return { resolveTypeReferenceDirectives, resolveModuleNames, @@ -767,6 +768,7 @@ export function makeSolutionBuilderHost( projectReferences ) => { instance.moduleResolutionCache?.update(options || {}); + instance.typeReferenceResolutionCache?.update(options || {}); const result = sysHost.createProgram( rootNames, options, @@ -775,6 +777,7 @@ export function makeSolutionBuilderHost( configFileParsingDiagnostics, projectReferences ); + instance.typeReferenceResolutionCache?.update(instance.compilerOptions); instance.moduleResolutionCache?.update(instance.compilerOptions); return result; }, @@ -1164,16 +1167,31 @@ function makeResolveTypeReferenceDirective( moduleResolutionHost: typescript.ModuleResolutionHost, customResolveTypeReferenceDirective: | CustomResolveTypeReferenceDirective - | undefined + | undefined, + instance: TSInstance ): ResolveTypeReferenceDirective { if (customResolveTypeReferenceDirective === undefined) { + // Till we the api is published + if ( + (compiler as any).createTypeReferenceDirectiveResolutionCache && + !instance.typeReferenceResolutionCache + ) { + instance.typeReferenceResolutionCache = (compiler as any).createTypeReferenceDirectiveResolutionCache( + moduleResolutionHost.getCurrentDirectory!(), + createGetCanonicalFileName(instance), + instance.compilerOptions, + instance.moduleResolutionCache?.getPackageJsonInfoCache?.() + ); + } return (directive, containingFile, redirectedReference) => - compiler.resolveTypeReferenceDirective( + // Till we the api is published + (compiler.resolveTypeReferenceDirective as any)( directive, containingFile, compilerOptions, moduleResolutionHost, - redirectedReference + redirectedReference, + instance.typeReferenceResolutionCache ); } From 749c00bbff31ac12f055d195f25351bf1503063b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 20 Apr 2021 12:04:59 -0700 Subject: [PATCH 05/11] Some updates --- src/servicesHost.ts | 4 ++-- src/watch-run.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 4cc01f09e..3d519e742 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -290,14 +290,14 @@ function makeResolvers( const resolveTypeReferenceDirectives = ( typeDirectiveNames: string[], containingFile: string, - _redirectedReference?: typescript.ResolvedProjectReference + redirectedReference?: typescript.ResolvedProjectReference ): (typescript.ResolvedTypeReferenceDirective | undefined)[] => typeDirectiveNames.map( directive => resolveTypeReferenceDirective( directive, containingFile, - _redirectedReference + redirectedReference ).resolvedTypeReferenceDirective ); diff --git a/src/watch-run.ts b/src/watch-run.ts index 553336173..8380404ea 100644 --- a/src/watch-run.ts +++ b/src/watch-run.ts @@ -24,6 +24,7 @@ export function makeWatchRun( instance.servicesHost?.clearCache?.(); instance.watchHost?.clearCache?.(); instance.moduleResolutionCache?.clear(); + instance.typeReferenceResolutionCache?.clear(); const promises = []; if (instance.loaderOptions.transpileOnly) { instance.reportTranspileErrors = true; From 8df84b2d690382a2852bc082ecbe55d6ac31b658 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 21 Apr 2021 12:12:59 -0700 Subject: [PATCH 06/11] Test baseline update --- .../expectedOutput-4.1/patch0/output.txt | 6 +++--- .../expectedOutput-4.1/patch0/output.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/comparison-tests/projectReferencesSymLinks/expectedOutput-4.1/patch0/output.txt b/test/comparison-tests/projectReferencesSymLinks/expectedOutput-4.1/patch0/output.txt index 38814c3da..a09cc7531 100644 --- a/test/comparison-tests/projectReferencesSymLinks/expectedOutput-4.1/patch0/output.txt +++ b/test/comparison-tests/projectReferencesSymLinks/expectedOutput-4.1/patch0/output.txt @@ -6,10 +6,10 @@ asset ../../lib/tsconfig.tsbuildinfo 2.73 KiB [emitted] cached modules 408 bytes [cached] 2 modules ./src/index.ts 108 bytes [built] [code generated] [1 error] -ERROR in app/src/index.ts +ERROR in app\src\index.ts ./src/index.ts 1:9-25 -[tsl] ERROR in app/src/index.ts(1,10) - TS2724: '"../../lib/dist"' has no exported member named 'getMeaningOfLife'. Did you mean 'getMeaningOfLife3'? +[tsl] ERROR in app\src\index.ts(1,10) + TS2724: '"../../node_modules/lib/dist"' has no exported member named 'getMeaningOfLife'. Did you mean 'getMeaningOfLife3'? ts-loader-default_d959ab86f3fcf84f webpack compiled with 1 error \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesSymLinks_WatchApi/expectedOutput-4.1/patch0/output.txt b/test/comparison-tests/projectReferencesSymLinks_WatchApi/expectedOutput-4.1/patch0/output.txt index b8286eba4..467201d5b 100644 --- a/test/comparison-tests/projectReferencesSymLinks_WatchApi/expectedOutput-4.1/patch0/output.txt +++ b/test/comparison-tests/projectReferencesSymLinks_WatchApi/expectedOutput-4.1/patch0/output.txt @@ -6,10 +6,10 @@ asset ../../lib/tsconfig.tsbuildinfo 2.73 KiB [emitted] cached modules 408 bytes [cached] 2 modules ./src/index.ts 108 bytes [built] [code generated] [1 error] -ERROR in app/src/index.ts +ERROR in app\src\index.ts ./src/index.ts 1:9-25 -[tsl] ERROR in app/src/index.ts(1,10) - TS2724: '"../../lib/dist"' has no exported member named 'getMeaningOfLife'. Did you mean 'getMeaningOfLife3'? +[tsl] ERROR in app\src\index.ts(1,10) + TS2724: '"../../node_modules/lib/dist"' has no exported member named 'getMeaningOfLife'. Did you mean 'getMeaningOfLife3'? ts-loader-default_ad9bee6dd825c8a5 webpack compiled with 1 error \ No newline at end of file From 317a72ac10ed0112dc20ce46a7be5d0ead35b1bf Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 22 Apr 2021 05:10:15 +0100 Subject: [PATCH 07/11] Update src/servicesHost.ts --- src/servicesHost.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/servicesHost.ts b/src/servicesHost.ts index 3d519e742..ff41f65b7 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -1170,7 +1170,7 @@ function makeResolveTypeReferenceDirective( instance: TSInstance ): ResolveTypeReferenceDirective { if (customResolveTypeReferenceDirective === undefined) { - // Till we the api is published + // Until the api is published if ( (compiler as any).createTypeReferenceDirectiveResolutionCache && !instance.typeReferenceResolutionCache From b29866c072c8df93249e7ee96370a45b2732d1e3 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 22 Apr 2021 05:11:23 +0100 Subject: [PATCH 08/11] Update src/servicesHost.ts --- src/servicesHost.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/servicesHost.ts b/src/servicesHost.ts index ff41f65b7..383d437a2 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -1183,7 +1183,7 @@ function makeResolveTypeReferenceDirective( ); } return (directive, containingFile, redirectedReference) => - // Till we the api is published + // Until the api is published (compiler.resolveTypeReferenceDirective as any)( directive, containingFile, From dc339b31a369876a94983d974d4457ecbe2943aa Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 22 Apr 2021 05:15:24 +0100 Subject: [PATCH 09/11] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e350ec82e..0322fea5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v9.1.0 + +* [Use caches for module resolution and type reference directives when using compiler default functions](https://github.com/TypeStrong/ts-loader/pull/1287) - thanks @sheetalkamat - uses: https://github.com/microsoft/TypeScript/pull/43700 + ## v9.0.2 * [Remove usage of loader-utils](https://github.com/TypeStrong/ts-loader/pull/1288) - thanks @jonwallsten From 1e4914251921c59516668c565a6c89d68ac9376b Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 22 Apr 2021 05:15:50 +0100 Subject: [PATCH 10/11] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a4a57d5ca..6e849b6ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-loader", - "version": "9.0.2", + "version": "9.1.0", "description": "TypeScript loader for webpack", "main": "index.js", "types": "dist", From 257333118632c32a0838e3470b6a1e209a92fad5 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 22 Apr 2021 05:25:02 +0100 Subject: [PATCH 11/11] Update src/interfaces.ts --- src/interfaces.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index b3e69f407..41077a6b9 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -169,7 +169,7 @@ export interface ModuleResolutionCache update(compilerOptions: typescript.CompilerOptions): void; getPackageJsonInfoCache?(): any; } -// Till api is updated +// Until the API has been released and ts-loader is built against a version of TypeScript that contains it - see https://github.com/microsoft/TypeScript/blob/74993a2a64bb2e423b40204bb54ff749cdd4ef54/src/compiler/moduleNameResolver.ts#L458 export interface TypeReferenceDirectiveResolutionCache { getOrCreateCacheForDirectory( directoryName: string,