-
Notifications
You must be signed in to change notification settings - Fork 12k
Allow globally loaded javascript libs #1717
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
Comments
In case anyone really needs this NOW, in Webpack, the solution is to do:
I do this in my I don't know if this works with SystemJS too. |
@iamyojimbo very good advice, thank you! |
#1747 adds instructions on how to use libs that need global scope using @iamyojimbo's technique. It should be enough for now but if people start having more problems with libs, we can add more functionality to address global scripts. |
We looked into it a bit more and decided to take another approach to the global libs issue. We decided to provide a config item to specify javascript files that should be loaded outside of the module ecosystem, as if they were in a script tag. We feel this should make it easier for people to add libs since they won't have to poke around for the exports, and also make it more compatible with all kinds of libs. |
@filipesilva by, "poke around the the exports", what do you mean exactly? |
Using your method, you need to know the exact names of the needed exports. For |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Some javascript libraries need to be loaded on the global scope, especially older ones. A great, common example is bootstrap, which needs jquery to be globally available.
Different build systems have different ways to allow this. Webpack has several alternatives to shimming modules, and so does SystemJS.
Angular-CLI needs to provide a way to load these files in order to provide interop with the simplest way of loading javascript files.
The text was updated successfully, but these errors were encountered: