Open Botato300 opened 4 months ago
Start a new pull request in StackBlitz Codeflow.
Similar https://github.com/vitejs/vite/issues/8739. Currently Vite reconstructs the links, hence the original attributes are not preserved. Vite does have partial support for preserving some attributes, but it has its own issues too: https://github.com/vitejs/vite/issues/9402
hello @bluwy . do you think it's something a newcomer can work on? If so, I would like to give a try.
I think this requires a fair bit of refactor to fix and likely some re-architecture to link handling, so probably not a good first issue for a newcomer 😅
I think this requires a fair bit of refactor to fix and likely some re-architecture to link handling, so probably not a good first issue for a newcomer 😅
wow, yeah I didn't see that. will try to find another issue. thank you!
Describe the bug
I am compiling my .html file with the command vite build, and when I see the final code, specifically the
<link>
tags that are in<head>
, they are different because it erases the attributes that I added.What I was expecting is this final code:
<link rel=“preload” as=“style” onload=“this.onload=null;this.rel=‘stylesheet’” href=“./assets/index-CjVjCqpO.css”>
What really happened...
<link rel=“stylesheet” crossorigin href=“./assets/index-CjVjCjCqpO.css”>
Reproduction
https://stackblitz.com/edit/vitejs-vite-2k4shi?file=dist%2Findex.html
Steps to reproduce
just run
npm run build
and see the generated html code and compare it with the originalSystem Info
Used Package Manager
npm
Logs
No response
Validations