-
Notifications
You must be signed in to change notification settings - Fork 12
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
Browser support #29
Comments
Producing a UMD build can easily be done with browserify – which is something we could add, so I don't really see the need to convert to ESM here (yet) – unless you have some convincing arguments? |
Besides the ESM support already available in Node 12 through the I like to use ESM in browser demos as it allows working against source without a build step. But this is not a pressing need for me at the moment. I just figured if making the steps to ensure the bundles worked in the browser, that one might as well future-proof the code and provide that functionality along the way. |
Right – that's not supported yet. Would having dedicated browserify bundle with a global export help with that (i.e. |
A global export would be helpful, sure, whether in a browser-specific build (wrapping the code in an IIFE to avoid conflicts and just setting the global So while a regular global would satisfy the major concern of this issue, I happen to prefer ESM for avoiding any globals or keeping track of dependencies out of context within my HTML. Rollup is very well documented and easy to setup and use (compared to Webpack or even Browserify), with the small caveat that you generally need to use plugins when importing npm dependencies ( Rollup also has the advantage of working with parcel, a popular means of making it easy to smoothly facilitate the installation of modules without users needing to manually manage this config. |
Your dependencies all appear that they would work in the browser, at least when pulled in through Rollup + rollup-plugin-node-builtins. Would you be willing to have source converted to ESM (producing also a UMD build)?
The text was updated successfully, but these errors were encountered: