Skip to content

Commit

Permalink
fix: watch package.json in more situations (#2332)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyu123 authored Apr 15, 2024
1 parent 15ccd2a commit 4cf8410
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class ModuleResolutionCache {
class ImpliedNodeFormatResolver {
private alreadyResolved = new FileMap<ReturnType<typeof ts.getModeForResolutionAtIndex>>();

constructor(private readonly tsSystem: ts.System) {}

resolve(
importPath: string,
importIdxInFile: number,
Expand Down Expand Up @@ -120,7 +122,7 @@ class ImpliedNodeFormatResolver {
sourceFile.impliedNodeFormat = ts.getImpliedNodeFormatForFile(
toVirtualSvelteFilePath(sourceFile.fileName) as any,
undefined,
ts.sys,
this.tsSystem,
compilerOptions
);
this.alreadyResolved.set(sourceFile.fileName, sourceFile.impliedNodeFormat);
Expand Down Expand Up @@ -186,7 +188,7 @@ export function createSvelteModuleLoader(
ts.ResolvedTypeReferenceDirectiveWithFailedLookupLocations
>();

const impliedNodeFormatResolver = new ImpliedNodeFormatResolver();
const impliedNodeFormatResolver = new ImpliedNodeFormatResolver(tsSystem);
const failedPathToContainingFile = new FileMap<FileSet>();
const failedLocationInvalidated = new FileSet();

Expand Down Expand Up @@ -266,7 +268,7 @@ export function createSvelteModuleLoader(
name,
containingFile,
compilerOptions,
ts.sys,
tsSystem,
tsModuleCache,
undefined,
mode
Expand Down

0 comments on commit 4cf8410

Please sign in to comment.