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

make immediate webpackable by not referencing global as global variable #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Michriko
Copy link

fixes #39

for usage in webpack environments when there is no chance for polyfills, the actual implementation causes crashes, as global is not defined.
the browserified version in the dist directory is not usable for webpack and especially for treeshaking. To fix this, global is not referenced anymore as global variable, it is passed to every function requiring it and the "global polyfill" is prepended to the index.js

fixes calvinmetcalf#39

for usage in webpack environments when there is no chance for polyfills, the actual implementation causes crashes, as global is not defined.
the browserified version in the dist directory is not usable for webpack and especially for treeshaking. To fix this, global is not referenced anymore as global variable, it is passed to every function requiring it and the "global polyfill" is prepended to the index.js
@funblaster22
Copy link

Unfortunately, it doesn't seem like this is getting merged anytime soon. I did however look at the code and I believe that globalThis can now be used instead of the switch statement you have.

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

Successfully merging this pull request may close these issues.

global not defined in webpack project
3 participants