Merged
Conversation
- vite.config.ts: ESM .mjs → .js, CJS .js → .cjs로 변경 - package.json main/module/exports 필드 업데이트 - main: dist/index.cjs (CJS) - module: dist/index.js (ESM) - exports: import "./dist/index.js", require "./dist/index.cjs" Next.js 13.5.6 webpack 버그 회피 및 Jest 호환성 개선 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
이 PR은 Vite 빌드 설정을 aioia-core 등 다른 라이브러리와 동일한 dual ESM/CJS 패턴으로 표준화하는 것을 목표로 하고 있습니다. package.json의 main, module, exports 필드를 수정하고 vite.config.ts에서 빌드 결과물의 확장자를 .mjs -> .js (ESM), .js -> .cjs (CJS)로 변경하는 내용이 포함되어 있습니다.
전반적으로 변경 사항은 명확하고 PR의 목적에 잘 부합합니다. Next.js 버그 회피 및 Jest 호환성 개선이라는 목표를 효과적으로 달성할 것으로 보입니다.
한 가지 유지보수성 향상을 위한 제안을 vite.config.ts 파일에 남겼습니다. fileName 함수의 구현을 조금 더 견고하게 만들어 향후 발생할 수 있는 실수를 방지하는 내용입니다.
|
🎉 This PR is included in version 0.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
Fancall의 Vite 빌드 설정을 aioia-core, trade-safety와 동일한 dual ESM/CJS 패턴으로 표준화합니다.
목적
.mjs→.js변경)주요 변경 사항
빌드 출력 파일명 변경
.mjs→.js.js→.cjspackage.json 필드 수정
main:dist/index.js→dist/index.cjs(CJS 진입점)module:dist/index.mjs→dist/index.js(ESM 진입점)exports["."].import:./dist/index.mjs→./dist/index.jsexports["."].require:./dist/index.js→./dist/index.cjsexports["./client"]도 동일하게 적용적용 대상
index,client기술 배경
.js확장자: Next.js 13.5.6에서 webpack이.mjs를 제대로 처리하지 못하는 버그 회피.cjs확장자: CommonJS 모듈 명시적 표시, Jest 호환성 강화테스트 체크리스트
npm run build:lib성공 (4개 파일 정상 생성)dist/index.js(ESM)dist/client.js(ESM)dist/index.cjs(CJS)dist/client.cjs(CJS)npm run format완료npm run lint:fix완료 (오류 없음)npm run type-check완료 (타입 오류 없음)npm pack결과 정상)참고
이 PR은 라이브러리 빌드 설정의 내부 구현을 변경하는 것으로, 타입 정의와 공개 API는 변경되지 않습니다. 소비자 프로젝트에서 기존대로 import/require를 사용할 수 있습니다.
🤖 Generated with Claude Code