Tuesday, 6 June 2017

Angular2 module as npm module

I have an Angular2 project. In it I have a DisplayModule which contains components/directives/pipes/services used to do display stuff.

What do I have to do to make this a npm module which I can them load in other projects.

So far I have:

  1. Extracted the folder as in a separate git folder, which contains the display.module.ts file in which I import and export all the relevant things from within this folder.

  2. Tried to find what to do with this folder so that I can import it. From my understanding the steps are as follows:

    a) do something to compile it into js files

    b) export those js files as a package

    c) publish those js files as a private npm package

    d) include this package with npm install in another project

As you have probably guessed I have no idea how to do all the points under 2.

Please help



via mp3por

No comments:

Post a Comment