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
i've got es5-shim with UMD, and synchronous inline script which uses this shim (it must be synchronous due to block html parsing) but require.js resolve es5shim dependency asynchronous, and inline script rise an error, because inline-script run before require(['es5-shim']) is done.
So UMD in case of such libraries, should always immediately run factory and exports for AMD its value;
also there is one more example why it should always immediately run factory, #78
The text was updated successfully, but these errors were encountered:
zhdanovme
changed the title
Should
UMD should always immediately run factory
Jun 30, 2016
jquery is in UMD format, but it runs factory func and set global $ and jQuery variable immediately, before any module requiring it.
So if you prepare the UMD output for a package, you can do it.
Since you probably have no control of es5-shim package, just load it using script tag BEFORE requirejs (or other AMD implementation). So that es5-shim's UMD code can do what it is designed to do: use global name space when AMD env is not available.
i've got es5-shim with UMD, and synchronous inline script which uses this shim (it must be synchronous due to block html parsing) but require.js resolve es5shim dependency asynchronous, and inline script rise an error, because inline-script run before require(['es5-shim']) is done.
So UMD in case of such libraries, should always immediately run factory and exports for AMD its value;
also there is one more example why it should always immediately run factory, #78
The text was updated successfully, but these errors were encountered: