Skip to content

Commit

Permalink
fix: fix import absolute path support
Browse files Browse the repository at this point in the history
  • Loading branch information
yeliex committed Aug 4, 2023
1 parent 555d17b commit dc5125c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/register/esm.mts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const resolve: ResolveFn = async (specifier, context, nextResolve) => {
}
}
if (DEFAULT_EXTENSIONS.some((ext) => specifier.endsWith(ext))) {
specifier = specifier.startsWith('file://') ? specifier : pathToFileURL(specifier);

Check failure on line 72 in packages/register/esm.mts

View workflow job for this annotation

GitHub Actions / stable - ubuntu-latest - node@18

Type 'string | URL' is not assignable to type 'string'.

Check failure on line 72 in packages/register/esm.mts

View workflow job for this annotation

GitHub Actions / stable - ubuntu-latest - node@18

Type 'string | URL' is not assignable to type 'string'.

Check failure on line 72 in packages/register/esm.mts

View workflow job for this annotation

GitHub Actions / stable - macos-latest - node@18

Type 'string | URL' is not assignable to type 'string'.

Check failure on line 72 in packages/register/esm.mts

View workflow job for this annotation

GitHub Actions / stable - macos-latest - node@18

Type 'string | URL' is not assignable to type 'string'.

Check failure on line 72 in packages/register/esm.mts

View workflow job for this annotation

GitHub Actions / stable - windows-latest - node@18

Type 'string | URL' is not assignable to type 'string'.

Check failure on line 72 in packages/register/esm.mts

View workflow job for this annotation

GitHub Actions / stable - windows-latest - node@18

Type 'string | URL' is not assignable to type 'string'.
const newUrl = `${specifier}.mjs`
TRANSFORM_MAP.set(newUrl, fileURLToPath(specifier))
return {
Expand Down

0 comments on commit dc5125c

Please sign in to comment.