Add ES module support by specifying import path in package.json#112
Add ES module support by specifying import path in package.json#112narekhovhannisyan merged 2 commits intomainfrom
Conversation
WalkthroughThe package.json exports map for "." was simplified: the previous object with "require" and "types" entries was replaced by a single string pointing to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
package.json(1 hunks)
🔇 Additional comments (1)
package.json (1)
43-50: Verify export field configuration aligns with package resolution standards.The "import" field has been added, which enables ESM consumers to import this package. However, ensure that:
- The build output (dist/index.js) is actually transpiled to ESM format by the TypeScript compiler
- If both "import" and "require" must point to the same file, confirm it's in a universally compatible format
- Consider whether separate CJS and ESM builds might be needed in the future for better tree-shaking and optimization
You can verify the actual module format by inspecting the generated dist/index.js file after running
yarn build.
|
@coderabbitai check |
|
@narekhovhannisyan: I'll review the changes in this PR for you. ✅ Actions performedReview triggered.
|
|
@coderabbitai check |
|
@narekhovhannisyan: I'll review the changes in this PR for you. ✅ Actions performedReview triggered.
|
Motivation
Changes
How to test
Images and GIFs
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.