Replies: 7 comments 13 replies
-
I'm also looking for guidance here, specifically on what files should be included in global #3033 (comment) mentions the ability to |
Beta Was this translation helpful? Give feedback.
-
@cwmrowe What version of Nx are you on? One option is to make the implicit dependencies for the package.json more granular. // nx.json "implicitDependencies": {
"angular.json": "*",
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
"tslint.json": "*",
"nx.json": "*",
"tsconfig.base.json": "*"
}, This only looks to see if the dependencies or devDependencies have changed, rather than the whole file itself. It should also only reflect what projects were affected by those changes. |
Beta Was this translation helpful? Give feedback.
-
I have created a GitHub repo with https://github.com/cwmrowe/nx-affected In this repo I have created a branch npm-dep where all I have done install |
Beta Was this translation helpful? Give feedback.
-
On a separate note I see that nx.json file for the newly created project has much less listed under
With the most notable omissions being I think what @wrslatz and myself are after is confirmation that:
|
Beta Was this translation helpful? Give feedback.
-
Thank you! This a great thread and everything is now working as expected :) |
Beta Was this translation helpful? Give feedback.
-
So one gotcha with how the dependencies are determined https://nx.dev/more-concepts/how-project-graph-is-built I had the following in my "~/*": ["./apps/ui/app/*", "/apps/api/src/*"], Because I wanted to use the same relative paths for my UI and API apps But I checked my That is because they use your This caused my API to depend on my UI project. FixI just created a seperate path mapping for my API project
|
Beta Was this translation helpful? Give feedback.
-
I also have this problem in 2024 with Nx 19.0.4 (also 20.0.3) Removing a path in tsconfig.base.json leads to ALL my projects being affected. I have a very ordinary tsconfig.base.ts with just a list of paths for every lib project. There are no "sharedGlobals" in nx.json and none of my inputs for targets or namedInputs includes tsconfig.base.json. How can I find out why Nx thinks all my projects are affected?
|
Beta Was this translation helpful? Give feedback.
-
I have introduced an Nx monorepo to our organisation and on the whole its going really well. Thank you Nrwl 🚀! My only issue is with how often the affected command seems to rebuilding all the apps. I think it boils down to everything getting rebuilt when any change to one of the following implicit dependencies is made.
So even if we add a library that is not yet referenced anywhere, everything is affected and rebuilt.
I was lead to believe from my research that Nx was clever enough only to rebuild what is "really" affected.
package.json
will only affect your app if your app depends on a package whose version has changed. But it seems that any change at all topackage.json
causes everything to get rebuilt.It would be really useful to know if there something wrong with my setup or my understanding here. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions