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

Is it necessary to provide a UMD format entry file by default? #206

Closed
AlexRen94 opened this issue Mar 7, 2022 · 4 comments
Closed

Is it necessary to provide a UMD format entry file by default? #206

AlexRen94 opened this issue Mar 7, 2022 · 4 comments

Comments

@AlexRen94
Copy link

As I import screenfull in a react project, the project will crash as webpack cannot import screenfull properly. I find the latest version
provide a esm file. If I import screenfull from node_modules it won't be transpiled by babel by default. The error is as follows:
image

A possible solution is to include screenfull in webpack config so as to be transpiled by babel-loader.

As a convention a package used in browser exposes a umd format file as a entry, to name a few, style-components,ant-design. So I would recommend provide a umd format rather than esm by default.

@sindresorhus
Copy link
Owner

As a convention a package used in browser exposes a umd format file as a entry, to name a few, style-components,ant-design.

That's the old convention. ESM is the new way and actually better for browser usage.

@sindresorhus
Copy link
Owner

@sindresorhus
Copy link
Owner

I have no plans to support UMD.

@AlexRen94
Copy link
Author

I have no plans to support UMD.

Anyway thanks for reply👍🏻

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

2 participants