Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): log number of prerendered routes …
Browse files Browse the repository at this point in the history
…in console

This changes add a log to the console to prints the total number of prerendered routes.

(cherry picked from commit 187accb)
  • Loading branch information
alan-agius4 committed Oct 30, 2023
1 parent b01ae6d commit 391ff78
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
transformSupportedBrowsersToTargets,
} from '../../tools/esbuild/utils';
import { checkBudgets } from '../../utils/bundle-calculator';
import { colors } from '../../utils/color';
import { copyAssets } from '../../utils/copy-assets';
import { getSupportedBrowsers } from '../../utils/supported-browsers';
import { executePostBundleSteps } from './execute-post-bundle';
Expand Down Expand Up @@ -250,15 +251,25 @@ export async function executeBuild(
executionResult.assetFiles.push(...result.additionalAssets);
}

await printWarningsAndErrorsToConsole(context, warnings, errors);

if (prerenderOptions) {
executionResult.addOutputFile(
'prerendered-routes.json',
JSON.stringify({ routes: prerenderedRoutes.sort((a, b) => a.localeCompare(b)) }, null, 2),
BuildOutputFileType.Root,
);

let prerenderMsg = `Prerendered ${prerenderedRoutes.length} static route`;
if (prerenderedRoutes.length > 1) {
prerenderMsg += 's.';
} else {
prerenderMsg += '.';
}

context.logger.info(colors.magenta(prerenderMsg) + '\n');
}

await printWarningsAndErrorsToConsole(context, warnings, errors);
const changedFiles =
rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputHashes);
logBuildStats(
Expand Down

0 comments on commit 391ff78

Please sign in to comment.