Skip to content

Commit 504958f

Browse files
feat(fonts): log number of downloaded files (#14783)
1 parent 24e28d2 commit 504958f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.changeset/big-worms-taste.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Improves the experimental Fonts API build log to show the number of downloaded files. This can help spotting excessive downloading because of misconfiguration

packages/astro/src/assets/fonts/vite-plugin-fonts.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ export function fontsPlugin({ settings, sync, logger }: Options): Plugin {
333333
throw new AstroError(AstroErrorData.UnknownFilesystemError, { cause });
334334
}
335335
if (fontFileDataMap) {
336-
logger.info('assets', 'Copying fonts...');
336+
logger.info(
337+
'assets',
338+
`Copying fonts (${fontFileDataMap.size} file${fontFileDataMap.size === 1 ? '' : 's'})...`,
339+
);
337340
await Promise.all(
338341
Array.from(fontFileDataMap.entries()).map(async ([hash, associatedData]) => {
339342
const data = await fontFetcher!.fetch({ hash, ...associatedData });

0 commit comments

Comments
 (0)