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 dynamic import on plain CJS files #789

Merged
merged 1 commit into from
Mar 26, 2023
Merged

Commits on Mar 26, 2023

  1. Fix dynamic import on plain CJS files

    Fixes #778
    
    Previously, `import()` transpiled to a promise-wrapped `require`, which worked
    fine for ESM-to-CJS-transpiled modules, but when importing plain CJS modules,
    the behavior was inconsistent with other implementations. In that case, we
    needed to call `_interopRequireWildcard` to nest the module under a `default`
    key.
    
    I tested to confirm that this updated behavior is consistent with Node
    ESM-to-CJS dynamic import, as well as Babel, TypeScript, and swc, so this change
    will be considered a bug fix rather than a breaking change, even though it is
    possible that existing use cases may have been relying on the old behavior.
    alangpierce committed Mar 26, 2023
    Configuration menu
    Copy the full SHA
    c59729c View commit details
    Browse the repository at this point in the history