From 85c7dc6263dd1efec6e2a91f7b3f583109c16510 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 11 Sep 2024 22:43:33 +0900 Subject: [PATCH] fix(build): improve addExtension esbuild plugin (#3405) --- build.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.ts b/build.ts index 82dda53d..a43d47bc 100644 --- a/build.ts +++ b/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 }