0

Using jspm 0.16.13, I've noticed that in addition to mapping "a module alias to a location or package" config.js map also seems to be defining a module's dependencies. For example, see the snippet below. However, in this particular example, at least on my generated config.js, this module doesn't appear anywhere else in the map.

"github:aurelia/logging-console@0.7.1": {
  "aurelia-logging": "github:aurelia/logging@0.7.0"
}

What I'm trying to do is create a "vendor" bundle using jspm... put all "third party" dependencies into it's own bundle. I need to manually list the modules because I'm using aurelia---including the "main aurelia module" won't automagically include it's dependencies. (That's probably true of other libraries as well.)

Can someone explain config.js map? Or provide a better way to list all of an app's dependencies?

U Avalos
  • 6,538
  • 7
  • 48
  • 81

1 Answers1

0

You can use bundle arithmetic to bundle your app dependencies into a vendor.js:

jspm bundle app/**/* - [app/**/*] vendor.js

Explanation of the syntax by Guy Bedford: https://github.com/jspm/jspm-cli/issues/1109#issuecomment-141385673

An alternative solution is to bundle all modules listed in the package.json:

https://github.com/jspm/jspm-cli/issues/1109#issuecomment-139529178

As for the map, it defines aliases (or dependencies, does not really matter) so that import statements can refer to a module using a short name. In the future, it will be possible to import a module using an URL.

Oleksii Rudenko
  • 1,277
  • 12
  • 23
  • You're saying that if I use the dependencies listed in package.json, that should be enough? I think I tried that and there were modules that were unbundled. Think it might be an aurelia thing. seems that config.js gives a more complete dependency list – U Avalos Oct 30 '15 at 15:32
  • if aurelia mangles config.js on its own it's possible that there is some extra content in config.js. But why does not it use jspm? – Oleksii Rudenko Oct 30 '15 at 16:00