Repository navigation
feat(builder): Add a cachePath option for the federation cache - #182
Merged
Merged
Conversation
Both builders take a cachePath, resolved against the workspace root, and default to node_modules/.cache/native-federation as before. A path at or above the workspace root is rejected, since core purges <cachePath>/<project> on an adapter minor bump. Refs #179
Drop the '.angular/cache/<version>' suggestion, which Angular purges on upgrade, and note that a custom cache folder must be gitignored.
Aukevanoost
added a commit
that referenced
this pull request
Oct 18, 2026
Backports 22.2.2..22.2.3 onto the Angular 21 layout. Incoming: - #177: i18n fails the build when localize-translate fails. - #178: init generates the v4 federation.config.mjs defaults (all of @angular/* shared with keepAll, denseExternals) and installs orchestrator ^4.8.0; the builder warns about flat externals and Angular packages shared without keepAll. - #182: cachePath builder option for the federation cache. - #183: federation outputs written as raw bytes. - @softarc/native-federation ~4.8.0, orchestrator ^4.8.0. Angular 21 specific adaptations: - None of the incoming changes touch @angular/build internals, so no // upstream: tags change (still angular-cli v21.2.19, 1a728258d6). - Skipped the remote builder schema/cachePath changes: this branch has no remote builder. - Kept the -v4 name, 21.2.15 version, ng21 pins and this branch's global pnpm overrides; main's nx>undici override isn't needed, the lock already resolves undici 7.29.1. - pnpm-lock.yaml regenerated rather than merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of #179: makes the federation cache location configurable. The default doesn't change.
Changes
cachePathoption on thebuildandremotebuilders. A relative path resolves against the workspace root; the default staysnode_modules/.cache/native-federation.resolveCachePath(src/utils/resolve-cache-path.ts) replaces the hard-codedgetDefaultCachePathcall in both builders. Everything that already readcache.cachePathfollows automatically: shared externals, the context tsconfigs, the compilerSourceFileCacheand the stylesheet cache.removeDiron<cachePath>/<project>, socachePath: "."could delete a source folder..angular/cache.purgeStaleBuildCachedeletes every folder there except the current version folder, andbuildApplicationInternalruns it on every build, including our own.Not in this PR
cli.cachesettings (part 2 of Make the federation cache location configurable #179), left for a follow-up or the next major.cachePathrow inv4/angular-adapter/builder.mdgoes to the website repo separately.Tests
src/utils/resolve-cache-path.spec.ts: default, relative, absolute,..segments, names that start with.., and rejecting the root and folders above it.pnpm typecheck,pnpm lintandpnpm testpass.Refs #179