mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
parent
33b8910cfd
commit
42785c7b78
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`
|
|
@ -287,15 +287,17 @@ async function generatePage(
|
||||||
builtPaths
|
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, generationOptions, pipeline);
|
await generatePath(path, generationOptions, pipeline);
|
||||||
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(pipeline.getConfig(), path, pageData.route.type);
|
const filePath = getOutputFilename(pipeline.getConfig(), path, pageData.route.type);
|
||||||
const lineIcon = i === paths.length - 1 ? '└─' : '├─';
|
const lineIcon = i === paths.length - 1 ? '└─' : '├─';
|
||||||
logger.info(null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`);
|
logger.info(null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`);
|
||||||
|
prevTimeEnd = timeEnd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue