Skip to content

Commit

Permalink
Fix handling for windows relative paths, current dir/parent dir witho…
Browse files Browse the repository at this point in the history
…ut trailing slash
  • Loading branch information
luxaritas committed Nov 16, 2023
1 parent bb038e9 commit e045434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/get-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function getFullCjsExports(url, context, parentLoad, source) {
const full = Array.from(new Set([
...addDefault(ex.exports),
...(await Promise.all(ex.reexports.map(re => getExports(
re.startsWith('./') || re.startsWith('../')
(/^(..?($|\/|\\))/).test(re)
? pathToFileURL(require.resolve(fileURLToPath(new URL(re, url)))).toString()
: pathToFileURL(require.resolve(re)).toString(),
context,
Expand Down

0 comments on commit e045434

Please sign in to comment.