vite icon indicating copy to clipboard operation
vite copied to clipboard

vite build alters the <link> tag wrongly

Open Botato300 opened this issue 1 month ago • 2 comments

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 original

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 5600G with Radeon Graphics
    Memory: 5.49 GB / 12.90 GB
  Binaries:
    Node: 18.16.1 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.19041.4355

Used Package Manager

npm

Logs

No response

Validations

Botato300 avatar May 27 '24 02:05 Botato300