Skip to content
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

fix(@angular-devkit/build-angular): correctly show initial files in stat table with esbuild builder #25017

Merged
merged 1 commit into from Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -103,13 +103,19 @@ export class BundlerContext {
outputFile.path = relativeFilePath;

if (entryPoint) {
// An entryPoint value indicates an initial file
initialFiles.push({
file: outputFile.path,
// The first part of the filename is the name of file (e.g., "polyfills" for "polyfills.7S5G3MDY.js")
name: basename(outputFile.path).split('.')[0],
extension: extname(outputFile.path),
});
// The first part of the filename is the name of file (e.g., "polyfills" for "polyfills.7S5G3MDY.js")
const name = basename(outputFile.path).split('.', 1)[0];

// Only entrypoints with an entry in the options are initial files.
// Dynamic imports also have an entryPoint value in the meta file.
if ((this.#esbuildOptions.entryPoints as Record<string, string>)?.[name]) {
// An entryPoint value indicates an initial file
initialFiles.push({
file: outputFile.path,
name,
extension: extname(outputFile.path),
});
}
}
}

Expand Down
Expand Up @@ -765,7 +765,7 @@ function logBuildStats(context: BuilderContext, metafile: Metafile, initialFiles

stats.push({
initial: initial.has(file),
stats: [file, initial.get(file) ?? '', output.bytes, ''],
stats: [file, initial.get(file) ?? '-', output.bytes, ''],
});
}

Expand Down