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

Revert ESM #3839

Merged
merged 3 commits into from
Dec 13, 2022
Merged

Revert ESM #3839

merged 3 commits into from
Dec 13, 2022

Conversation

devongovett
Copy link
Member

This reverts #3630. Unfortunately, it broke support for webpack 4, which still gets over 8 million downloads per week (over 2x more than webpack 5). This would be a huge breaking change.

The issue is that webpack 4 treats .mjs files as "strict ESM", attempting to follow native Node behavior. This means any imports within .mjs will not be resolved using the "module" field in package.json. webpack 4 also does not support the "exports" field. Therefore, the CommonJS version will be loaded from the "main" field. But, it is also loaded in strict ESM mode, meaning __esModule interop is also disabled, leading to compilation errors. Some additional information can be found in webpack/webpack#7482.

@devongovett devongovett merged commit 0182ad0 into main Dec 13, 2022
@devongovett devongovett deleted the revert-esm branch December 13, 2022 00:18
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

3 participants