简体   繁体   中英

Is there a method to separate dependencies object from package.json file of an angular project?

Here is the scenario I have multiple angular applications which belong to the same project. When I needed to upgrade an npm package, I need to change all the package.json files in each application.I tried mono repo, but it does not apply to my project because npm scripts are not the same as all apps.

So I want to separate the node dependencies from applications and keep npm scripts of the package.json files.

Is there a way to separate only the dependencies object from the package.json file? OR any other suggestions?

If I understood well this could not be done with npm but seems like it can be achieved with yarn workspaces:

Guide for installing yarn:

Unfortunately npm do not support package.json inheritance. See this link .

On the other side why don't you customize your npm scripts? create alias for every npm command. eg

"test-app1": "ng test app1",
"test-app2": "ng test app2 --code-coverage --no-watch --no-progress --browsers ChromeHeadlessNoSandbox",

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM