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

Add a separate build for browsers #73

Merged
merged 6 commits into from
Jan 26, 2019
Merged

Add a separate build for browsers #73

merged 6 commits into from
Jan 26, 2019

Conversation

eemeli
Copy link
Owner

@eemeli eemeli commented Jan 11, 2019

This fixes #72 by adding a separate build of the library that targets browser environments, using a browserslist rule > 0.5%, not dead which effectively means being limited by what IE 11 requires. At least for now this build does depend on @babel/runtime, which is not included in the package's dependencies, as it's not needed by the Node build. Is there a way of specifying separate dependencies for the "main" and "browser" versions of a package?

It seems to work, but I'd like to verify that by adding browser-based tests. And with that I'd really appreciate some help, as I've no prior experience in setting up a CI pipeline that would allow for e.g. Jest tests to be run on Selenium in the Sauce Labs or Browserstack clouds. Anyone?

At the same time I've tuned the Node build's Babel preset-env config to target Node 6.5 in order to trim down it's somewhat overly-cautious rules, while making sure that actual compatibility with at least Node 6.0.0 is still maintained.

Based on some testing with Webpack, it looks like the browser version gzips to about 22kB (including @babel/runtime), but the autogenerated set of polyfills browser/dist/polyfill.js would add about 14kB on top of that (compressed). If we do get browser tests set up, that could/should get whittled down quite a bit.

@eemeli eemeli added the help wanted Extra attention is needed label Jan 11, 2019
@eemeli
Copy link
Owner Author

eemeli commented Jan 26, 2019

I'm merging this in order to push out a new release, and will continue developing its browser tests in a separate repo as it doesn't really make sense to include all of the Webpack toolchain and other related artifacts here.

@eemeli eemeli merged commit d1b1373 into master Jan 26, 2019
@eemeli eemeli deleted the better-build branch January 26, 2019 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Classes in bundled code breaks IE11 compatibility
1 participant