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 }