Skip to content

Commit

Permalink
fix(build): improve addExtension esbuild plugin (#3405)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored Sep 11, 2024
1 parent 73ff6c0 commit 85c7dc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const addExtension = (extension: string = '.js', fileExtension: string = '.ts'):
} else {
tsPath = path.join(args.resolveDir, args.path, `index${fileExtension}`)
if (fs.existsSync(tsPath)) {
importPath = `${args.path}/index${extension}`
if (args.path.endsWith('/')) {
importPath = `${args.path}index${extension}`
} else {
importPath = `${args.path}/index${extension}`
}
}
}
return { path: importPath, external: true }
Expand Down

0 comments on commit 85c7dc6

Please sign in to comment.