Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 polyfillsbrowser/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.