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

jszip usage breaks for projects that use @babel/preset-env #579

Open
icopp opened this issue Jan 15, 2019 · 1 comment
Open

jszip usage breaks for projects that use @babel/preset-env #579

icopp opened this issue Jan 15, 2019 · 1 comment

Comments

@icopp
Copy link

icopp commented Jan 15, 2019

  • jszip uses a require("core-js/library/fn/set-immediate") statement at one point
  • A Babel build with @babel/preset-env and "useBuiltIns": "entry" uses a custom-minified version of core-js including only the polyfills needed to make the list of that project's supported browsers work
  • The resulting bundle doesn't include setImmediate (because nothing in the bundle actually references setImmediate as a global function)
  • ...which leads to jszip breaking, because it's trying to require something not in the bundle

The "right" behavior here would be to either (a) just use setImmediate directly, and leave it up to the end user as to whether they want to use the polyfill, or (b) use a standalone setImmediate ponyfill instead of pulling in the entire core-js library.

@icopp icopp changed the title jszip usage breaks on projects breaks for projects that use @babel/preset-env jszip usage breaks for projects that use @babel/preset-env Jan 15, 2019
@RinkAttendant6
Copy link

It looks like the core-js dependency was replaced with set-immediate-shim in #532.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants