Skip to content

Commit

Permalink
chore: @modern-kit/utils SubPath 제공 (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 authored Jan 15, 2025
1 parent 0564805 commit d86d4d0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-games-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modern-kit/react': major
---

chore: @modern-kit/react SubPath 제공 - @ssi0214
2 changes: 1 addition & 1 deletion packages/react/build.utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -70,7 +70,7 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
},
"./dist/*": {
Expand All @@ -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"
Expand Down
5 changes: 1 addition & 4 deletions packages/react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -33,7 +30,7 @@ export default {
dir: './dist',
sourcemap: true,
format: 'cjs',
entryFileNames: (chunkInfo) => getFormatEntryFileNames(chunkInfo, 'js'),
entryFileNames: (chunkInfo) => getFormatEntryFileNames(chunkInfo, 'cjs'),
},
{
dir: './dist',
Expand Down
3 changes: 3 additions & 0 deletions packages/react/subPaths.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const componentsPathKeys = [
'index',
'AspectRatio',
'ClientGate',
'Mounted',
Expand All @@ -19,6 +20,7 @@ export const componentsPathKeys = [
];

export const hooksPathKeys = [
'index',
'useAsyncEffect',
'useAsyncProcessQueue',
'useBeforeUnload',
Expand Down Expand Up @@ -72,6 +74,7 @@ export const hooksPathKeys = [
];

export const utilsPathKey = [
'index',
'mergeRefs',
'polymorphicForwardRef',
// 신규 유틸 모듈 추가 시 추가
Expand Down

0 comments on commit d86d4d0

Please sign in to comment.