We hit this in an Nx monorepo: every build/serve rewrites whatever tsconfig tsConfig points at (reformats include, adds/drops entries), and for us that's the app's real, checked-in tsconfig.app.json. Constant noise in every PR.
Traced it to ignoreUnusedDeps (on by default). When it's on, updateFederationTsConfig() writes the resolved shared-lib entry points into that tsconfig, right before the same file is handed to the Angular compiler for that same build. So it's not just a pruning side effect — those shared libs live outside the app's src/** (reached only via a path mapping), and the Angular compiler won't touch their decorators unless they're listed in include. Turning ignoreUnusedDeps off to stop the churn just breaks the build instead (File '...' not found in TypeScript compilation).
Questions:
- Is mutating the build's own tsconfig meant to double as a permanent, version-controlled file? Would've saved us a while if that were documented somewhere.
- Any chance the entry points could get passed straight to the compiler instead of round-tripping through a file on disk?
- If not, maybe an option to point the rewrite somewhere other than tsConfig (a generated/cache file by default) so monorepo folks don't have to build this themselves.
What we're doing for now: keep ignoreUnusedDeps on, but point tsConfig at a gitignored sibling instead of the real one.
// nx.json
"targetDefaults": {
"@angular-architects/native-federation:build": {
"options": { "tsConfig": "{projectRoot}/tsconfig.federation.json" }
}
}
That file's just:
{ "extends": "./tsconfig.app.json", "include": ["src/**/*.d.ts"] }
seeded by a tiny script we run in prepare so it exists before anyone builds. {projectRoot} gets substituted fine, so it's one config line for every app, no per-project changes needed. Posting the workaround here in case anyone else runs into this before you weigh in.
We hit this in an Nx monorepo: every build/serve rewrites whatever tsconfig tsConfig points at (reformats include, adds/drops entries), and for us that's the app's real, checked-in tsconfig.app.json. Constant noise in every PR.
Traced it to ignoreUnusedDeps (on by default). When it's on, updateFederationTsConfig() writes the resolved shared-lib entry points into that tsconfig, right before the same file is handed to the Angular compiler for that same build. So it's not just a pruning side effect — those shared libs live outside the app's src/** (reached only via a path mapping), and the Angular compiler won't touch their decorators unless they're listed in include. Turning ignoreUnusedDeps off to stop the churn just breaks the build instead (File '...' not found in TypeScript compilation).
Questions:
What we're doing for now: keep ignoreUnusedDeps on, but point tsConfig at a gitignored sibling instead of the real one.
That file's just:
seeded by a tiny script we run in prepare so it exists before anyone builds.
{projectRoot}gets substituted fine, so it's one config line for every app, no per-project changes needed. Posting the workaround here in case anyone else runs into this before you weigh in.