Serve lossless WOFF2 browser fonts outside blocking stylesheets

This commit is contained in:
syntaxbullet
2026-09-08 16:25:37 +02:00
parent 9f552bf608
commit 03eb8d9e7a
14 changed files with 78 additions and 7 deletions

View File

@@ -0,0 +1,9 @@
import type { BunPlugin } from "bun";
/** Match the production bundler's external font URLs in the HTML dev server. */
export default {
name: "external-browser-fonts",
setup(build) {
build.onResolve({ filter: /^\/fonts\/browser\// }, args => ({ path: args.path, external: true }));
},
} satisfies BunPlugin;