Skip to content

fix(esbuild): resolve to ESM when requested #4220

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

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

bgotink
Copy link
Member

@bgotink bgotink commented Mar 14, 2022

What's the problem this PR addresses?

ESBuild uses package exports to load files based on whether import or require was used.
Configuring the PnP plugin breaks this behaviour, always resorting to CJS/require code.

How did you fix it?

Copy the logic ESBuild uses to decide on what conditions to pass in its resolution

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@merceyz merceyz changed the title feat(esbuild-plugin-pnp): resolve to ESM when requested fix(esbuild): resolve to ESM when requested Mar 15, 2022
@arcanis arcanis merged commit 26539e6 into yarnpkg:master Mar 15, 2022
@bgotink bgotink deleted the fix/esbuild-plugin-esm branch March 15, 2022 13:55
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.

3 participants