Skip to content

Commit

Permalink
Fix referencing of TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
illright committed May 30, 2024
1 parent ee36d72 commit a331d69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/resolve-import.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { resolveModuleName, sys, type CompilerOptions } from "typescript";
import ts from "typescript";
import type { CompilerOptions } from "typescript";

/**
* Given a file name, an imported path, and a TSConfig object, produce a path to the imported file, relative to TypeScript's `baseUrl`.
Expand Down Expand Up @@ -40,8 +41,8 @@ export function resolveImport(
directoryExists?: (path: string) => boolean,
): string | null {
return (
resolveModuleName(importedPath, importerPath, tsCompilerOptions, {
...sys,
ts.resolveModuleName(importedPath, importerPath, tsCompilerOptions, {
...ts.sys,
fileExists,
directoryExists,
}).resolvedModule?.resolvedFileName ?? null
Expand Down

0 comments on commit a331d69

Please sign in to comment.