How to modify the output HTML?

How can I retrieve the build output filename of a specified file in the build:manifest hook of the build function and then insert it into the HTML (link href=...)?

Because vite-plugin-webfont-dl is used, the vite plugin outputs a CSS file during build/generate. This file is output to the _nuxt folder and contains a hash, but it is not automatically set to be imported, resulting in it not being imported in the HTML.

The method I've researched so far is to accurately obtain the output filename of the CSS (including the hash) from build:manifest, but I can't, or don't know, how to insert it into the HTML. Perhaps preerender can be used for non-SSR mode, but what about SSR mode?
Was this page helpful?