Can angular2-jwt be added to the DefinitelyTyped repo, like angular-jwt had been?
Adding it to the DefinitelyTyped repo is currently the path for compatibility with the Angular2 CLI
It is a native typescript library and as such does not need to be added to definitely typed.
got it - so typings install npm:angular2-jwt should do the trick?
I don't think you should need to do anything. typescript will pick up the typings from the node_modules/angular2-jwt folder. You should only need typings for projects that don't distribute their typings in their npm module.
Could be wrong though.
I added the following line in angular-cli-build.js:
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
// existing code
// .....
'angular2-jwt/**/*.+(js|js.map)' // <---------------------------
]
});
};
Would this solve your issue? The .d.ts files are also in the npm package in case you need them for other purposes.
You'll need to add the following to get angular2-jwt to work with angular-cli:
In angular-cli-build.js:
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
// existing code
// .....
'angular2-jwt/**/*.+(js|js.map)' // <---------------------------
]
});
};
In system-config.ts:
/** Map relative paths to URLs. */
const map: any = {
'angular2-jwt': 'vendor/angular2-jwt' // <---------------------------
};
/** User packages configuration. */
const packages: any = {
'angular2-jwt': { // <---------------------------
main: 'angular2-jwt.js' // <---------------------------
},
};
Above seems to be working for me.
Source: https://github.com/angular/angular-cli/wiki/3rd-party-libs
Most helpful comment
You'll need to add the following to get
angular2-jwtto work withangular-cli:In
angular-cli-build.js:In
system-config.ts:Above seems to be working for me.
Source: https://github.com/angular/angular-cli/wiki/3rd-party-libs