简体   繁体   中英

Nrwl Nx and monorepo - handle package.json for particular apps

for a frontend architecture I'm evaluating the usage of monorepo with Nrwl Nx.
I understood from the docs that Nx strongly recommends the single-policy for dependencies (a root package.json with all the dependencies used by the apps and libs).

Today's goal is to find out if there is some solution to use for any reason a different dependency version for a specific application (aka more than one package.json inside the monorepo).

The scenario that I'm trying to analyze is the follow:

root package.json contains
somelib@1.2.2

This means that every app will use the version 1.2.2. Everything works fine until the day cursedApp needs to use somelib@1.1.9.

There's any solution for this? I read the docs and this pattern is discouraged and the only proposal that I've found is to remove the cursedApp from the monorepo.

Thanks! D

https://nx.dev/packages/node/executors/webpack#generatepackagejson it says:-

Generates a package.json file with the project's node_module dependencies populated for installing in a container. If a package.json exists in the project's directory, it will be reused with dependencies populated.

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