Skip to content

Commit

Permalink
Merge pull request #41 from egmacke/master
Browse files Browse the repository at this point in the history
Fixes relative paths should keep ext when defined
  • Loading branch information
jonkwheeler committed Feb 17, 2023
2 parents 9c44c52 + 88a4da9 commit 18f63c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const absToRel = (modulePath: string, outFile: string): string => {
moduleSrc = moduleSrc.replace(moduleExt, '')
}
if (existsSync(moduleSrc) || exts.some(ext => existsSync(moduleSrc + ext))) {
const rel = toRelative(dirname(srcFile), moduleSrc)
const rel = toRelative(dirname(srcFile), moduleExt ? `${moduleSrc}${moduleExt}` : moduleSrc)

replaceCount += 1

Expand Down

0 comments on commit 18f63c2

Please sign in to comment.