I created a sample Angular2 application where one of my modules uses an external (rest) library, for example:
/// <reference path="../../typings/tsd.d.ts" /> import rest = require('rest'); import jsonpClient = require('rest/client/jsonp'); import mime = require('rest/interceptor/mime'); ...
I used
tsd install rest
who placed rest.d.ts in the typings directory and used
bower install rest
to get the version of execution (it wasn’t explained anywhere. I assume that I need to do something like this?)
I installed my gulp script to copy two directories from bower_components ("rest" and its dependency "when") to dist / lib
The application itself compiles fine, but in the browser it is not possible to resolve the rest / with module dependencies.
I added
System.config({ "baseURL": "/", "transpiler": "traceur", "paths": { "components/*": "components/*.js", "provider/*": "provider/*.js", "services/*": "services/*.js", "model/*": "model/*.js", "rest": "lib/rest/rest.js", "rest/*": "lib/rest/*.js", "when": "lib/when/when.js", "when/*": "lib/when/*.js", "*": "lib/*.js" } });
to the index.html file, and I probably continue to add files to this list, but somehow it seems ... wrong.
Of course, it can't be right, what should I list each internal package structure in my index.html? I see that the when module expects to find its own dependencies in ./lib, where rest has a completely different structure.
So my questions are: