1

I created library which sits under angular/dist folder and I pushed whole project to Bonobo git server.

I want to include this library in pakcage.json in Angular

Should I store only library folder (which is folder under angular/dist) on git server? and how can I include in package.json?

sally
  • 379
  • 2
  • 8
  • 17

1 Answers1

0

You can install from folder or git repo, following is npm i -h.

$ npm i -h

npm install (with no args, in package dir)
npm install [<@scope>/]<pkg>
npm install [<@scope>/]<pkg>@<tag>
npm install [<@scope>/]<pkg>@<version>
npm install [<@scope>/]<pkg>@<version range>
npm install <alias>@npm:<name>
npm install <folder>
npm install <tarball file>
npm install <tarball url>
npm install <git:// url>
npm install <github username>/<github project>

So, this question has two solution:

1. Install from folder

git submodule add <library repo url> <folder of library>

npm i file:<folder of library>

2. Install from git remote repo

npm i <library repo url>

Or include commit-ish.

npm i <library repo url>#<commit-ish>
Puckwang
  • 424
  • 1
  • 5
  • 11