fix: resolve ESM imports from hoisted dependencies - #26
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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 |
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.
Summary
node_modules/lib/imports unchanged when no matching ESM module is availableContext
This fixes the module lookup failure behind ant-design/ant-design-icons#760. In that monorepo, Father runs from
packages/icons-react, while@ant-design/icons-svgis hoisted to the repository root. The previous filesystem check therefore missed the existing ESM build and left CommonJS imports in the React ESM output.Once this plugin is released and adopted, the local alias workaround in ant-design/ant-design-icons#768 can be removed.
Related to #4.
Verification
npm run buildnpm test— 3/3 passednpm run lintfather doctor@ant-design/icons-svg/lib/asn/SmileOutlinedimport to@ant-design/icons-svg/es/asn/SmileOutlinedgit diff --check