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.
|
// Get paths for the route, calling getStaticPaths if needed.
|
||||||
const paths = await getPathsForRoute(pageData, pageModule, opts, builtPaths);
|
const paths = await getPathsForRoute(pageData, pageModule, opts, builtPaths);
|
||||||
|
|
||||||
|
let prevTimeEnd = timeStart;
|
||||||
for (let i = 0; i < paths.length; i++) {
|
for (let i = 0; i < paths.length; i++) {
|
||||||
const path = paths[i];
|
const path = paths[i];
|
||||||
await generatePath(path, opts, generationOptions, manifest, onRequest);
|
await generatePath(path, opts, generationOptions, manifest, onRequest);
|
||||||
const timeEnd = performance.now();
|
const timeEnd = performance.now();
|
||||||
const timeChange = getTimeStat(timeStart, timeEnd);
|
const timeChange = getTimeStat(prevTimeEnd, timeEnd);
|
||||||
const timeIncrease = `(+${timeChange})`;
|
const timeIncrease = `(+${timeChange})`;
|
||||||
const filePath = getOutputFilename(opts.settings.config, path, pageData.route.type);
|
const filePath = getOutputFilename(opts.settings.config, path, pageData.route.type);
|
||||||
const lineIcon = i === paths.length - 1 ? '└─' : '├─';
|
const lineIcon = i === paths.length - 1 ? '└─' : '├─';
|
||||||
info(opts.logging, null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`);
|
info(opts.logging, null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`);
|
||||||
|
prevTimeEnd = timeEnd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue