mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 18:18:57 +01:00
fix(build): improve addExtension esbuild plugin (#3405)
This commit is contained in:
parent
73ff6c0e82
commit
85c7dc6263
6
build.ts
6
build.ts
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user