diff --git a/.changeset/slimy-games-tap.md b/.changeset/slimy-games-tap.md new file mode 100644 index 00000000..d146bf41 --- /dev/null +++ b/.changeset/slimy-games-tap.md @@ -0,0 +1,5 @@ +--- +'@modern-kit/react': major +--- + +chore: @modern-kit/react SubPath 제공 - @ssi0214 diff --git a/packages/react/build.utils.mjs b/packages/react/build.utils.mjs index 849b031c..99236454 100644 --- a/packages/react/build.utils.mjs +++ b/packages/react/build.utils.mjs @@ -12,7 +12,7 @@ export const getFormatEntryFileNames = (chunkInfo, format) => { }; for (const [key, value] of Object.entries(prefixMap)) { - if (chunkInfo.name === key) { + if (chunkInfo.name === `${key}-index`) { return `${key}/index.${format}`; } diff --git a/packages/react/package.json b/packages/react/package.json index e31ef919..4b4131cc 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -3,7 +3,7 @@ "sideEffects": false, "version": "1.27.7", "description": "modern-kit/react", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "files": [ @@ -70,7 +70,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" }, "./dist/*": { @@ -80,7 +80,7 @@ }, "./*": { "types": "./dist/*/index.d.ts", - "require": "./dist/*/index.js", + "require": "./dist/*/index.cjs", "import": "./dist/*/index.mjs" }, "./package.json": "./package.json" diff --git a/packages/react/rollup.config.mjs b/packages/react/rollup.config.mjs index a1a4160a..77397d13 100644 --- a/packages/react/rollup.config.mjs +++ b/packages/react/rollup.config.mjs @@ -20,9 +20,6 @@ const extensions = ['.js', '.jsx', '.ts', '.tsx']; export default { preserveModules: true, input: { - components: './src/components/index.ts', - hooks: './src/hooks/index.ts', - utils: './src/utils/index.ts', index: './src/index.ts', // 진입 경로, ...getSubEntryMap(componentsPathKeys, 'components'), ...getSubEntryMap(hooksPathKeys, 'hooks'), @@ -33,7 +30,7 @@ export default { dir: './dist', sourcemap: true, format: 'cjs', - entryFileNames: (chunkInfo) => getFormatEntryFileNames(chunkInfo, 'js'), + entryFileNames: (chunkInfo) => getFormatEntryFileNames(chunkInfo, 'cjs'), }, { dir: './dist', diff --git a/packages/react/subPaths.mjs b/packages/react/subPaths.mjs index d7cdb7ea..787998ec 100644 --- a/packages/react/subPaths.mjs +++ b/packages/react/subPaths.mjs @@ -1,4 +1,5 @@ export const componentsPathKeys = [ + 'index', 'AspectRatio', 'ClientGate', 'Mounted', @@ -19,6 +20,7 @@ export const componentsPathKeys = [ ]; export const hooksPathKeys = [ + 'index', 'useAsyncEffect', 'useAsyncProcessQueue', 'useBeforeUnload', @@ -72,6 +74,7 @@ export const hooksPathKeys = [ ]; export const utilsPathKey = [ + 'index', 'mergeRefs', 'polymorphicForwardRef', // 신규 유틸 모듈 추가 시 추가