Skip to content

Commit 285e04b

Browse files
committed
fixup! fix(@angular/build): enhance build logs and output location for library builder
1 parent 145bfe8 commit 285e04b

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

‎packages/angular/build/src/builders/library/builder.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,16 @@ export async function* executeLibraryBuilder(
148148
watcher,
149149
buildAction,
150150
);
151+
if (isWatchMode && progress) {
152+
logger.info('Watch mode enabled. Watching for file changes...');
153+
}
154+
151155
yield initialResult;
152156

153157
if (!isWatchMode || !watcher) {
154158
return;
155159
}
156160

157-
if (progress) {
158-
logger.info('Watch mode enabled. Watching for file changes...');
159-
}
160-
161161
yield* runWatchLoop(
162162
watcher,
163163
normalizedOptions,

‎packages/angular/build/src/builders/library/tests/behavior/build_spec.ts‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ describeLibraryBuilder(executeLibraryBuilder, LIBRARY_BUILDER_INFO, (harness) =>
173173
...BASE_OPTIONS,
174174
});
175175

176-
const { result, logs } = await harness.executeOnce();
176+
const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false });
177177
expect(result?.success).toBeFalse();
178178
expect(logs).toContain(
179179
jasmine.objectContaining({
@@ -189,5 +189,21 @@ describeLibraryBuilder(executeLibraryBuilder, LIBRARY_BUILDER_INFO, (harness) =>
189189
}),
190190
);
191191
});
192+
193+
it('should log watch mode enabled after initial build in watch mode', async () => {
194+
harness.useTarget('build', {
195+
...BASE_OPTIONS,
196+
watch: true,
197+
});
198+
199+
const { result, logs } = await harness.executeOnce();
200+
expect(result?.success).toBeTrue();
201+
expect(logs).toContain(
202+
jasmine.objectContaining({
203+
level: 'info',
204+
message: 'Watch mode enabled. Watching for file changes...',
205+
}),
206+
);
207+
});
192208
});
193209
});

0 commit comments

Comments
 (0)