Skip to content

Commit 391ff78

Browse files
committed
fix(@angular-devkit/build-angular): log number of prerendered routes in console
This changes add a log to the console to prints the total number of prerendered routes. (cherry picked from commit 187accb)
1 parent b01ae6d commit 391ff78

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/angular_devkit/build_angular/src/builders/application/execute-build.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
transformSupportedBrowsersToTargets,
3030
} from '../../tools/esbuild/utils';
3131
import { checkBudgets } from '../../utils/bundle-calculator';
32+
import { colors } from '../../utils/color';
3233
import { copyAssets } from '../../utils/copy-assets';
3334
import { getSupportedBrowsers } from '../../utils/supported-browsers';
3435
import { executePostBundleSteps } from './execute-post-bundle';
@@ -250,15 +251,25 @@ export async function executeBuild(
250251
executionResult.assetFiles.push(...result.additionalAssets);
251252
}
252253

254+
await printWarningsAndErrorsToConsole(context, warnings, errors);
255+
253256
if (prerenderOptions) {
254257
executionResult.addOutputFile(
255258
'prerendered-routes.json',
256259
JSON.stringify({ routes: prerenderedRoutes.sort((a, b) => a.localeCompare(b)) }, null, 2),
257260
BuildOutputFileType.Root,
258261
);
262+
263+
let prerenderMsg = `Prerendered ${prerenderedRoutes.length} static route`;
264+
if (prerenderedRoutes.length > 1) {
265+
prerenderMsg += 's.';
266+
} else {
267+
prerenderMsg += '.';
268+
}
269+
270+
context.logger.info(colors.magenta(prerenderMsg) + '\n');
259271
}
260272

261-
await printWarningsAndErrorsToConsole(context, warnings, errors);
262273
const changedFiles =
263274
rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputHashes);
264275
logBuildStats(

0 commit comments

Comments
 (0)