Git Product home page Git Product logo

Comments (5)

sch0lar avatar sch0lar commented on September 21, 2024 8

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

from angular2-jwt.

escardin avatar escardin commented on September 21, 2024

It is a native typescript library and as such does not need to be added to definitely typed.

from angular2-jwt.

getglad avatar getglad commented on September 21, 2024

got it - so typings install npm:angular2-jwt should do the trick?

from angular2-jwt.

escardin avatar escardin commented on September 21, 2024

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.

from angular2-jwt.

colltoaction avatar colltoaction commented on September 21, 2024

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.

from angular2-jwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.