Skip to content

fix(@angular/build): exclude unmodified files from logs with `--local… #29596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -184,9 +184,6 @@ export async function executeBuild(

executionResult.outputFiles.push(...outputFiles);

const changedFiles =
rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputInfo);

// Analyze files for bundle budget failures if present
let budgetFailures: BudgetCalculatorResult[] | undefined;
if (options.budgets) {
@@ -288,6 +285,8 @@ export async function executeBuild(
}

if (!jsonLogs) {
const changedFiles =
rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputInfo);
executionResult.addLog(
logBuildStats(
metafile,
7 changes: 6 additions & 1 deletion packages/angular/build/src/tools/esbuild/utils.ts
Original file line number Diff line number Diff line change
@@ -40,6 +40,11 @@ export function logBuildStats(
ssrOutputEnabled?: boolean,
verbose?: boolean,
): string {
// Remove the i18n subpath in case the build is using i18n.
// en-US/main.js -> main.js
const normalizedChangedFiles: Set<string> = new Set(
[...(changedFiles ?? [])].map((f) => basename(f)),
);
const browserStats: BundleStats[] = [];
const serverStats: BundleStats[] = [];
let unchangedCount = 0;
@@ -52,7 +57,7 @@ export function logBuildStats(
}

// Show only changed files if a changed list is provided
if (changedFiles && !changedFiles.has(file)) {
if (normalizedChangedFiles.size && !normalizedChangedFiles.has(file)) {
++unchangedCount;
continue;
}