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

Using type module breaks preset-env polyfills #1337

Open
m10 opened this issue Sep 10, 2024 · 0 comments
Open

Using type module breaks preset-env polyfills #1337

m10 opened this issue Sep 10, 2024 · 0 comments

Comments

@m10
Copy link

m10 commented Sep 10, 2024

When using Webpack Encore in a project with "type": "module" in package.json the resulting bundle file contains require calls which include the polyfills through @babel/preset-env. These should have been replaced by wepack with the file contents. This problem does not occur when using a simple plain webpack config.

Removing "type": "module" (and rewriting the config as commonjs) the issue is not present.

Reproduction repository: https://github.com/m10/encore-type-module
Also see branch "commonjs" for a working version without type module: https://github.com/m10/encore-type-module/tree/commonjs
and the branch "webpack" for a working version with type module but without encore, using a simple webpack config instead: https://github.com/m10/encore-type-module/tree/webpack

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

No branches or pull requests

1 participant