Closed rockResolve closed 6 years ago
Unfortunately I can't find a way to make an npm package (ms-signalr-client) use an existing github dependency (jquery).
You could install ms-signalr-client using jspm with overrides to remove the dependency (which will mean your config.js won't keep losing your changes when you use jspm):
$ jspm install npm:ms-signalr-client -o "{ registry: 'jspm', main: 'jquery.signalr-2.2.0',
shim: { 'jquery.signalr-2.2.0': { deps:[]}}, dependencies: {}}
I wondered if that might be the case. Might be worth documenting.
jQuery could be listed as a peer dependency in SignalR instead of a required dependency. Leave it up to the developer to make sure jQuery is installed and usable.
I added this to my Jspm app which already had Bootstrap. Bootstrap also has a jQuery dependency, but adds it via github registry. So I ended up with jQuery in both the github & npm registry.
When I ran my app github jQuery is run, then bootstrap. Later when signalr is run, jspm sees the npm jquery as a different dependency, loads & runs it. This destroys my bootstrap extensions with an error like "$element.tooltip is not a function"
Hack fix: remove signalr jquery dependency in config.js