Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/poor-grapes-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a case where using the `<Font />` component would throw a Rollup error during the build
4 changes: 2 additions & 2 deletions packages/astro/src/assets/fonts/vite-plugin-fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ export function fontsPlugin({ settings, sync, logger }: Options): Plugin {
return RESOLVED_VIRTUAL_MODULE_ID;
}
},
load(id, opts) {
if (id === RESOLVED_VIRTUAL_MODULE_ID && opts?.ssr) {
load(id) {
if (id === RESOLVED_VIRTUAL_MODULE_ID) {
return {
code: `export const fontsData = new Map(${JSON.stringify(Array.from(resolvedMap?.entries() ?? []))})`,
};
Expand Down