jspm / registry

The jspm registry and package.json override service
https://jspm.io
229 stars 256 forks source link

v0.17 Can't seem to force jQuery to load before Angular #983

Closed dasch88 closed 7 years ago

dasch88 commented 7 years ago

I've recently upgraded my code base from jspm v0.16.x to v0.17. I've been able to work out all the kinks so far with one exception. One of the plugins that I use requires that jQuery is used within Angular...and thus I need to make sure jQuery loads first.

I tried adding metadata to indicate that Angular had a dependency on jQuery, but had a terrible time getting this new version to respect it. I've tried:

  1. Specifically adding it to the overrides section of package.json and running jspm install: "npm:angular@1.5.8": { "format": "global", "jspmNodeConversion": false, "main": "angular", "meta": { "angular.js": { "exports": "angular", "format": "global", "deps": ["jquery"] } } }
  2. Set the meta dependency directly in jspm.config.js: meta: { "angular": { "deps": [ "jquery" ] } }

Is there a different way that I should be using?

guybedford commented 7 years ago

I think you'd want to try either jspm install npm:angular@1.5.8 -o "{shim:{angular:{deps:['jquery'], exports: 'global'}}}" ormeta: { 'angular/angular.js': { deps: ['jquery'] } }`. Meta configurations do need to line up carefully, it's always a little tricky.

dasch88 commented 7 years ago

Great, thank you--I finally got it to work by just doing "meta": { "*": { "exports": "angular", "format": "global", "deps": [ "jquery" ] } } inside the angular override inside package.json and running jspm install again