Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): rollup setting 수정 #686

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/strange-vans-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modern-kit/react': patch
---

fix(react): rollup setting 수정 - @ssi02014
6 changes: 2 additions & 4 deletions packages/react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { getSubEntryMap, getFormatEntryFileNames } from './build.utils.mjs';
const extensions = ['.js', '.jsx', '.ts', '.tsx'];

export default {
preserveModules: false,
preserveModules: true,
input: {
components: './src/components/index.ts',
hooks: './src/hooks/index.ts',
Expand All @@ -33,14 +33,12 @@ export default {
dir: './dist',
sourcemap: true,
format: 'cjs',
preserveModules: false,
entryFileNames: (chunkInfo) => getFormatEntryFileNames(chunkInfo, 'js'),
},
{
dir: './dist',
sourcemap: true,
format: 'esm',
preserveModules: false,
entryFileNames: (chunkInfo) => getFormatEntryFileNames(chunkInfo, 'mjs'),
},
],
Expand All @@ -57,7 +55,7 @@ export default {
exclude: ['**/*.spec.tsx', '**/*.spec.ts', './src/_internal/test/*'],
}),
commonjs(),
esbuild(),
esbuild({ minify: true }),
postcss({
modules: true,
minimize: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/LazyImage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { forwardRef } from 'react';
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
import { useMergeRefs } from '../../hooks/useMergeRefs';
import { mergeRefs } from '../../utils/mergeRefs';

export interface LazyImageProps
extends React.ComponentProps<'img'>,
Expand Down Expand Up @@ -44,7 +44,7 @@ export const LazyImage = forwardRef<HTMLImageElement, LazyImageProps>(
rootMargin,
});

return <img ref={useMergeRefs(ref, imgRef)} {...restProps} />;
return <img ref={mergeRefs(ref, imgRef)} {...restProps} />;
}
);

Expand Down
Loading