angular - I am building & linking my angular2 library to my main project, inside the libraries build folder node_modules in comming -


i have created angular2 component library , linking library main project.

when build library, creating build folder, execute npm-link inside build folder, creating node_modules folder packages inside build folder(which should not happen).

now when link library main project, getting error, error because of repetation of node_modules twice. (node_modules of main project & node_modules library problem. think there should 1 node_modules of main project.)

here steps following link library main project.

inside library

  1. "npm run build:clean"

  2. "npm run build:link"

  3. go inside build folder , run "npm link" (at point node_modules created)

inside project

  1. npm link @nw/ui-vdp

  2. ng serve --proxy-config proxy.config.test.json --aot

my libraries package.json is

  "scripts": {      "build:ngc": "ngc -p src/tsconfig-ngc.json -w",      "build": "npm run build:ngc && npm run copyassets",      "build:clean": "del-cli build",      "watch": "npm-watch build",      "lint": "tslint src/**/*.ts",      "test": "rimraf coverage/ && karma start --single-run",      "copyfiles": "npm run copyassets && copyfiles package.json build",      "copyassets": "copyfiles -u 1 \"src/**/*.*\" build",      "release:npm": "npm run build:clean && npm run build  && npm run copyfiles && npm publish build",      "build:link": "npm run build:clean && npm run build && npm run copyfiles"    },  

can suggest me how stop including of node_modules inside libraries build folder.

do not use --save. example - install ngx-bootstrap in project using command:-

npm install ngx-bootstrap --save 

-- save save library in package.json file. install app without using --save this:-

npm install ngx-bootstrap  

using file library not included in package.json file install library install. can see in node_modules folder.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -