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

Resolve third-party plugins with exports in their package.json #14775

Conversation

philipp-spiess
Copy link
Member

@philipp-spiess philipp-spiess commented Oct 24, 2024

This PR fixes an issue when trying to resolve plugins with exports in their package.json, like @headlessui/tailwindcss. The missing conditionNames in the enhanced resolver config would cause it to not properly look up the name.

Test Plan

I added a test using the postcss setup (the existing plugin tests are inside the CLI setup but the CLI can only ever run in Module JS mode).

To ensure the tests are resolving to the right environment (CJS vs MJS), I added logging of the import.meta.url value to the resolver code. When run, this was the output:

Screenshot 2024-10-24 at 15.28.10.png

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @philipp-spiess and the rest of your teammates on Graphite Graphite

@philipp-spiess philipp-spiess marked this pull request as ready for review October 24, 2024 13:33
@philipp-spiess philipp-spiess requested a review from a team as a code owner October 24, 2024 13:33
@philipp-spiess philipp-spiess force-pushed the 10-24-resolve_third-party_plugins_with_exports_in_their_package.json_ branch from 261a308 to 0c8bebd Compare October 24, 2024 13:33
@adamwathan adamwathan merged commit 35cd2ff into next Oct 24, 2024
2 checks passed
@adamwathan adamwathan deleted the 10-24-resolve_third-party_plugins_with_exports_in_their_package.json_ branch October 24, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants