You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For anyone reading this, this is how I did it in the meanwhile:
Create a small plugin to not hash the font files (otherwise we can't reference them in our html)
functionVitePluginRemoveHashFontFiles(){return{name: 'Remove hash from font files',apply: 'build',enforce: 'post',config(config){constdefaultAssetFileNames=config.build.rollupOptions.output.assetFileNames;config.build.rollupOptions.output.assetFileNames=({ type, name })=>{if(type==='asset'&&/\.(woff2?|ttf|otf)$/.test(name))return`[name].[ext]`;returndefaultAssetFileNames;};}};}constconfig={plugins: [sveltekit(),VitePluginRenameCSSFontFiles()]};
Then you can add your preload link somewhere in your app
Describe the problem
For performance, you probably want to either
preload
fonts orswap
themDescribe the proposed solution
There's an
ssrManifest
option that can be passed to the client build that we're not using today. It would generate anssr-manifest.json
which includes the font filesAlternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: