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

fix: default imports of transient deps of an inlined commonjs dep #190

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

rturnq
Copy link
Contributor

@rturnq rturnq commented Feb 6, 2025

Description

Rollup rewrites require calls to default imports for commonjs dependencies; however, if the dependency gets inlined, its require calls which were assumed to be commonjs are also rewritten but now resolve from an ESM context and the default import is no longer safe due to conditional exports. This tells Rollup which dependencies are ESM so it uses a namespace import instead.

Motivation and Context

Screenshots (if appropriate):

Checklist:

  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

Copy link

changeset-bot bot commented Feb 6, 2025

🦋 Changeset detected

Latest commit: 3250979

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rturnq rturnq force-pushed the cjs-default-imports branch from c267f01 to 3250979 Compare February 6, 2025 17:05
@rturnq rturnq merged commit a648063 into main Feb 6, 2025
7 checks passed
@rturnq rturnq deleted the cjs-default-imports branch February 6, 2025 17:52
@github-actions github-actions bot mentioned this pull request Feb 6, 2025
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.

1 participant