Pierre-Luc BLOT
Pierre-Luc BLOT

Reputation: 439

How to create Angular2 npm package with angular-cli?

I would like create a npm package for a project. I used angular-cli to create my components I would like package.

My tsconfig.json

{
   "compilerOptions": {
      "declaration": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "lib": ["es6", "dom"],
      "mapRoot": "./",
      "module": "es6",
      "moduleResolution": "node",
      "outDir": "../dist/out-tsc",
      "sourceMap": true,
      "target": "es5",
      "typeRoots": [
        "../node_modules/@types"
      ]
   } 
}

I can generate *.d.ts with ng build

And then, with npm link I can test my package into other project, but my module which contains my components is not found.. :/

Have you some ideas ? :)

Upvotes: 0

Views: 2254

Answers (1)

Soojoo
Soojoo

Reputation: 2156

Hi I think this documentation will help you. I have successfully created npm package using yoman from my angular2 component.

Upvotes: 4

Related Questions