You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background:
In a webpack project depending directly or indirectly via other npm packages on immediate, you need to shim the global variable as webpack does not use the browserified scripts in the dist directory.
In some cases, shiming is not possible (e.g. WebWorker that are created by the AngularCLI).
This causes e.g. the webworker to crash as global is not known.
Proposal:
Do not expect global to be defined.
Define the global variable in index.js and use same logic as in browserify for setting the global object.
Then provide the global Object to all functions relying on global
The text was updated successfully, but these errors were encountered:
Michriko
pushed a commit
to Michriko/immediate
that referenced
this issue
Sep 17, 2021
fixescalvinmetcalf#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
Background:
In a webpack project depending directly or indirectly via other npm packages on immediate, you need to shim the global variable as webpack does not use the browserified scripts in the dist directory.
In some cases, shiming is not possible (e.g. WebWorker that are created by the AngularCLI).
This causes e.g. the webworker to crash as global is not known.
Proposal:
Do not expect global to be defined.
Define the global variable in index.js and use same logic as in browserify for setting the global object.
Then provide the global Object to all functions relying on global
The text was updated successfully, but these errors were encountered: