sindresorhus/screenfull

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

AlexRen94 opened this issue · 4 comments

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.

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.

I have no plans to support UMD.

I have no plans to support UMD.

Anyway thanks for reply👍🏻