Skip to content

Does single-spa root require AMD? #271

Discussion options

You must be logged in to vote

The amd.js extra is not needed in every case, but it was included because it's often needed. For example, loading the official versions of react properly is easiest to do with the amd.js extra (although using the esm-bundle version of react also works). The amd.js extra creates the window.define global variable, which can cause problems for apps using requirejs, or for apps that load global libraries via script tag but are in UMD format.

The UMD format, which is popular for libraries published to npm, first checks whether window.define is present. If so, it calls window.define. Otherwise, it creates a global variable. In the case of popular libraries like jQuery that are usually needed as…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@misha-antoshchuk
Comment options

Answer selected by misha-antoshchuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants