Bug: dev: true forces watch mode in ng build builder
Description
When the Native Federation ng build builder runs with dev: true, watch mode is activated regardless of the watch option. Passing watch: false alongside
dev: true is silently ignored, so the build never exits and continues running as a watcher.
Steps to reproduce
- Configure a project that uses @angular-architects/native-federation:build.
- Invoke the builder with dev: true and watch: false.
- Observe that the process does not terminate after the initial build and continues to react to file changes.
Expected behavior
watch: false should take precedence: the builder should perform a single dev build and exit. dev should only control whether dev-mode artifacts are
produced, not whether the builder watches for changes.
Actual behavior
The builder enables file watching and the rebuild loop whenever dev is truthy, ignoring watch: false.
Root cause
In packages/angular/src/builders/build/builder.ts, the watcher and rebuild branches are gated by nfBuilderOptions.dev || watch:
- builder.ts:330 — nfBuilderOptions.dev || watch ? createNfWatcher() : undefined
- builder.ts:406 — else if (!first && (nfBuilderOptions.dev || watch))
These should be gated on watch only (or dev && watch), so that an explicit watch: false disables the watch loop even in dev mode.
##Suggested fix
Replace the nfBuilderOptions.dev || watch checks with watch (the already-normalized value at builder.ts:150) so that watch is the single source of truth
for watch-mode activation.
Bug:
dev: trueforces watch mode inng buildbuilderDescription
When the Native Federation
ng buildbuilder runs withdev: true, watch mode is activated regardless of the watch option. Passing watch: false alongsidedev: trueis silently ignored, so the build never exits and continues running as a watcher.Steps to reproduce
Expected behavior
watch: false should take precedence: the builder should perform a single dev build and exit. dev should only control whether dev-mode artifacts are
produced, not whether the builder watches for changes.
Actual behavior
The builder enables file watching and the rebuild loop whenever dev is truthy, ignoring watch: false.
Root cause
In packages/angular/src/builders/build/builder.ts, the watcher and rebuild branches are gated by
nfBuilderOptions.dev || watch:These should be gated on watch only (or dev && watch), so that an explicit watch: false disables the watch loop even in dev mode.
##Suggested fix
Replace the
nfBuilderOptions.dev || watchchecks with watch (the already-normalized value at builder.ts:150) so that watch is the single source of truthfor watch-mode activation.