mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
parent
442f946116
commit
fa6b68a776
2 changed files with 8 additions and 1 deletions
5
.changeset/lovely-walls-call.md
Normal file
5
.changeset/lovely-walls-call.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Improve fidelity of time stats when running `astro build`
|
|
@ -272,15 +272,17 @@ async function generatePage(
|
|||
// Get paths for the route, calling getStaticPaths if needed.
|
||||
const paths = await getPathsForRoute(pageData, pageModule, opts, builtPaths);
|
||||
|
||||
let prevTimeEnd = timeStart;
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const path = paths[i];
|
||||
await generatePath(path, opts, generationOptions, manifest, onRequest);
|
||||
const timeEnd = performance.now();
|
||||
const timeChange = getTimeStat(timeStart, timeEnd);
|
||||
const timeChange = getTimeStat(prevTimeEnd, timeEnd);
|
||||
const timeIncrease = `(+${timeChange})`;
|
||||
const filePath = getOutputFilename(opts.settings.config, path, pageData.route.type);
|
||||
const lineIcon = i === paths.length - 1 ? '└─' : '├─';
|
||||
info(opts.logging, null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`);
|
||||
prevTimeEnd = timeEnd;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue