-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Intent to ship browser packages as ES Modules exclusively #1
Comments
5 tasks
fregante
added a commit
to fregante/fit-textarea
that referenced
this issue
Apr 5, 2020
fregante
added a commit
to fregante/fit-textarea
that referenced
this issue
Apr 5, 2020
fregante
added a commit
to fregante/doma
that referenced
this issue
Apr 6, 2020
fregante
added a commit
to fregante/tiny-version-compare
that referenced
this issue
Apr 6, 2020
niksy
added a commit
to niksy/generator-paleta
that referenced
this issue
May 5, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
npm
modules never end up in the browser without a compilation/bundling step¹ and since all bundlers now support ES Modules (natively or viaesm
package) it makes no sense to keep shipping Common JS modules, which have compatibility issues with ES Modules and different expectations for multiple exports.Browser + node packages
Only ship CommonJS, since they're supported everywhere and most bundlers also have a compatibility layer to enable
import
ing them, which correctly selects the "default" CommonJS export.Browser-only packages
Only ship ES Module, since the only reason to have CommonJS modules at the moment is to support older Node versions.
This will change as Node finalizes ES Module support and is widespread enough to completely and finally drop CommonJS.
¹ If you want to use one of my
npm
-only modules directly in the browser, I provide apackd
link that makes a bundle for you, example: fregante/webext-options-sync@37d606aThe text was updated successfully, but these errors were encountered: