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

refactor: remove auto detect esmodule #142

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Conversation

JSerFeng
Copy link
Collaborator

In the early days, SWC has an issue that is it injected __esModule unexpectedly, see here, so at that time, I use is_esm to check if the input code is esModule or not, if it isn't, then __esModule should not present in the exports, and I can remove it in the output code.

However this detection is not robust enough, it did not take import.meta and top-level-await into account, thank @咲奈Sakina for mentioning this.

Now, SWC fixed this issue, and we no longer need this behavior.

@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2023

🦋 Changeset detected

Latest commit: 19ac260

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

This PR includes changesets to release 1 package
Name Type
@modern-js/swc-plugins Minor

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

@JSerFeng JSerFeng requested a review from chenjiahan July 11, 2023 07:35
@JSerFeng JSerFeng force-pushed the refactor/remove-esm-detect branch 3 times, most recently from d23e953 to 1af6a18 Compare July 11, 2023 07:48
@chenjiahan chenjiahan merged commit fb5dfd3 into main Jul 11, 2023
3 checks passed
@chenjiahan chenjiahan deleted the refactor/remove-esm-detect branch July 11, 2023 08:01
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