From 0dc5dc1973b8c254ed6d3cd289091e9e257ba3d3 Mon Sep 17 00:00:00 2001 From: ghdtjgus76 Date: Wed, 12 Jun 2024 18:46:21 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B3=80=EC=88=98=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/scripts/generateBuildConfig.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/scripts/generateBuildConfig.ts b/packages/scripts/generateBuildConfig.ts index 331bbce7..73fd7e5f 100644 --- a/packages/scripts/generateBuildConfig.ts +++ b/packages/scripts/generateBuildConfig.ts @@ -33,17 +33,17 @@ const getFilteredComponentFiles = async (directoryPath: string) => { const createPaths = (type: "entryFile" | "exports", file: string) => { const componentDirName = file.split("/")[0] ?? ""; const componentName = file.split("/")[1]?.slice(0, -4) ?? ""; - const isComponent = file.endsWith("index.tsx"); + const defaultComponent = file.endsWith("index.tsx"); - const typesPath = `./dist/components/${componentDirName}/${isComponent ? "index" : componentName}.d.ts`; - const importPath = `./dist/${isComponent ? componentDirName : componentName}.js`; - const requirePath = `./dist/${isComponent ? componentDirName : componentName}.cjs`; - const componentPath = `./src/components/${componentDirName}${isComponent ? "" : `/${componentName}`}`; + const typesPath = `./dist/components/${componentDirName}/${defaultComponent ? "index" : componentName}.d.ts`; + const importPath = `./dist/${defaultComponent ? componentDirName : componentName}.js`; + const requirePath = `./dist/${defaultComponent ? componentDirName : componentName}.cjs`; + const componentPath = `./src/components/${componentDirName}${defaultComponent ? "" : `/${componentName}`}`; - const entryFileKey = isComponent + const entryFileKey = defaultComponent ? `./${componentDirName}` : `./${componentName}`; - const exportsKey = isComponent ? componentDirName : componentName; + const exportsKey = defaultComponent ? componentDirName : componentName; const exportsValue = { types: typesPath, require: requirePath,