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

Add ESM wrapper to avoid dual package hazard #566

Merged
merged 3 commits into from
Oct 6, 2023
Merged

Conversation

timostamm
Copy link
Member

@timostamm timostamm commented Sep 29, 2023

Fixes #509 with the solution proposed in #509 (comment).

We've tested the approach in connectrpc/examples-es#1002 in various versions of Node.js, esbuild, parcel, rollup, vite, and webpack. Tree-shaking continues to work as expected with the "module" condition, and the dual package hazard is resolved with the esm wrappers in the "import" condition.

@fubhy
Copy link
Contributor

fubhy commented Oct 5, 2023

Wonderful. Thank you @timostamm !

@timostamm timostamm marked this pull request as ready for review October 6, 2023 12:27
@timostamm timostamm merged commit 7973287 into main Oct 6, 2023
5 checks passed
@timostamm timostamm deleted the tstamm/esmwrapper branch October 6, 2023 14:01
@timostamm timostamm mentioned this pull request Oct 6, 2023
@Andarist
Copy link

Excellent work on this! :)

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.

Dual package hazard
4 participants