From e17f3286d51751e6d04e6f8a6552b0cf83c4872a Mon Sep 17 00:00:00 2001 From: devjiwonchoi Date: Sun, 19 Nov 2023 03:18:28 +0900 Subject: [PATCH] refac: skip loop if no filename --- src/build-config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/build-config.ts b/src/build-config.ts index 7687ffcd..5eadba2d 100644 --- a/src/build-config.ts +++ b/src/build-config.ts @@ -463,9 +463,10 @@ async function buildConfig( if (dts) { const dtsExt = dtsExtentions[ext] - const filename = filenameWithoutExtension(binDistPath) ?? '' - const binTypeFile = `${filename}${dtsExt}` + const filename = filenameWithoutExtension(binDistPath) + if (!filename) continue + const binTypeFile = `${filename}${dtsExt}` outputExports.push(binTypeFile) } else { // ESM by default, CJS if the file extension is .cjs