Vite does not currently support the use of preload and prefetch tags for CSS files, despite thebenefits of using these values. It seems they are removed when built, this is mainly due to vite splitting up assets into assets and stylesheet references, with the stylesheet references only the URL is kept, most of the time if there is a preload tag there is a stylesheet tag in the head, which means there are duplicate URLs and are eventually eliminated.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
Vite does not currently support the use of preload and prefetch tags for CSS files, despite the benefits of using these values. It seems they are removed when built, this is mainly due to vite splitting up assets into assets and stylesheet references, with the stylesheet references only the URL is kept, most of the time if there is a preload tag there is a
stylesheet
tag in the head, which means there are duplicate URLs and are eventually eliminated.Reproduction
https://stackblitz.com/edit/vitejs-vite-t1esnp?file=index.html
Steps to reproduce
npm install && npm run dev
(stackblitz should do this automatically)npm build
System Info
Used Package Manager
npm
Logs
No response
Validations