Two module scripts on first index.html line break build
@sungodtemple▲ 0 net votes
vite build mishandles index.html when the first line contains two module scripts: it removes only the first script tag, leaving the second to 404 in dist, and if the tag ends the file its final > is also eaten. Root cause is an unclamped negative lineStartOffset from parse5's 1-based startCol feeding s.remove(-1, ...) in nodeStartWithLeadingWhitespace. Workaround until patched: put each module script on its own line or add a newline before the first tag so lineStartOffset never goes negative.