Demo URL
https://stackblitz.com/edit/vitejs-vite-dkfcgxck
What happened?
When build.ssrManifest: true is enabled in Vite, unplugin-fonts pollutes the entire ssr-manifest.json graph. The assets generated by the plugin (such as .woff2 font files, global SVGs, and images) leak into every single chunk in the manifest, including core runtime helpers (modulepreload-polyfill.js, @vue/reactivity, etc.).
This completely breaks the purpose of SSR chunk optimization, as the SSR server reads this manifest and forces the browser to preload every single font and image asset globally on every page request.
Reproduction steps
1. Open the provided reproduction link.
2. Run `npm run build` in the terminal.
3. Inspect the generated `ssr-manifest.json` file.
*Note for StackBlitz:* The `.vite` folder is hidden by default in the sidebar. To inspect the generated manifest after building, run this command in the terminal:
`cat dist/.vite/ssr-manifest.json`
Relevant log output
{
"\u0000unfonts.css": [
"/assets/vite-BF8QNONU.svg",
"/assets/hero-CLDdwZDr.png",
"/assets/Roboto-Bold-CjXAX5wa.woff2",
"/assets/Roboto-Medium-B3yustc1.woff2",
"/assets/Roboto-Regular-BQDBHXny.woff2"
],
"\u0000vite/modulepreload-polyfill.js": [
"/assets/vite-BF8QNONU.svg",
"/assets/hero-CLDdwZDr.png",
"/assets/Roboto-Bold-CjXAX5wa.woff2",
"/assets/Roboto-Medium-B3yustc1.woff2",
"/assets/Roboto-Regular-BQDBHXny.woff2"
],
"node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js": [
"/assets/vite-BF8QNONU.svg",
"/assets/hero-CLDdwZDr.png",
"/assets/Roboto-Bold-CjXAX5wa.woff2",
"/assets/Roboto-Medium-B3yustc1.woff2",
"/assets/Roboto-Regular-BQDBHXny.woff2"
]
}
What browsers are you seeing the problem on?
No response
What is your operating system?
No response
Demo URL
https://stackblitz.com/edit/vitejs-vite-dkfcgxck
What happened?
When
build.ssrManifest: trueis enabled in Vite,unplugin-fontspollutes the entiressr-manifest.jsongraph. The assets generated by the plugin (such as.woff2font files, global SVGs, and images) leak into every single chunk in the manifest, including core runtime helpers (modulepreload-polyfill.js,@vue/reactivity, etc.).This completely breaks the purpose of SSR chunk optimization, as the SSR server reads this manifest and forces the browser to preload every single font and image asset globally on every page request.
Reproduction steps
Relevant log output
{ "\u0000unfonts.css": [ "/assets/vite-BF8QNONU.svg", "/assets/hero-CLDdwZDr.png", "/assets/Roboto-Bold-CjXAX5wa.woff2", "/assets/Roboto-Medium-B3yustc1.woff2", "/assets/Roboto-Regular-BQDBHXny.woff2" ], "\u0000vite/modulepreload-polyfill.js": [ "/assets/vite-BF8QNONU.svg", "/assets/hero-CLDdwZDr.png", "/assets/Roboto-Bold-CjXAX5wa.woff2", "/assets/Roboto-Medium-B3yustc1.woff2", "/assets/Roboto-Regular-BQDBHXny.woff2" ], "node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js": [ "/assets/vite-BF8QNONU.svg", "/assets/hero-CLDdwZDr.png", "/assets/Roboto-Bold-CjXAX5wa.woff2", "/assets/Roboto-Medium-B3yustc1.woff2", "/assets/Roboto-Regular-BQDBHXny.woff2" ] }What browsers are you seeing the problem on?
No response
What is your operating system?
No response