chore: update rollup config#291
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an esm distribution target to the package, updating package.json exports and scripts, and refactoring rollup.config.mjs to output ESM builds to both lib and esm directories. It also adds dynamic external package detection. The review feedback correctly points out that TypeScript declaration files (.d.ts) are currently only generated for the lib directory, which will cause compilation errors for consumers importing from the new esm path. The dtsConfig output should be updated to target both directories.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| preserveModules: true, | ||
| preserveModulesRoot: 'src', | ||
| }, | ||
| external: isExternal, |
There was a problem hiding this comment.
Since this PR introduces the esm directory as a distribution target (and exposes it in package.json exports), the TypeScript declaration files (.d.ts) should also be generated for the esm directory. Currently, dtsConfig only outputs to lib, which will cause TypeScript compilation errors for consumers importing from @antv/layout/esm/* due to missing type definitions. Please update the output property of dtsConfig to be an array containing both lib and esm outputs, similar to esmConfig.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v5 #291 +/- ##
=======================================
Coverage 86.00% 86.00%
=======================================
Files 77 77
Lines 5946 5946
Branches 1444 1437 -7
=======================================
Hits 5114 5114
Misses 831 831
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
No description provided.