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

feat: support mix cjs and esm #76

Merged
merged 6 commits into from
Oct 19, 2023
Merged

feat: support mix cjs and esm #76

merged 6 commits into from
Oct 19, 2023

Conversation

underfin
Copy link
Contributor

@underfin underfin commented Oct 19, 2023

Description

Implemention

  1. The module will detect esm export syntax and cjs exports to make module syntax.
  2. The esm import and cjs export will be supported at both cjs & esm module.
  3. If a module mix esm export and cjs exports, here will use esm export, the cjs export will be ignored and it will throw error at runtime.

Here has a different implement with esbuild, if a module hasn't esm export syntax and cjs exports, esbuild will mark it to cjs, but fllowing the behavior will caused rollup behavior error, so rolldown will mark it to esm.

You can see detail at #74. The warning i will add at next pr.

Test Plan

Added.


@underfin underfin merged commit 22794c3 into main Oct 19, 2023
4 checks passed
@underfin underfin deleted the hybrid-cjs-esm branch October 19, 2023 08:37
@underfin underfin restored the hybrid-cjs-esm branch November 19, 2023 08:23
@underfin underfin deleted the hybrid-cjs-esm branch November 19, 2023 08:30
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.

None yet

2 participants