[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
In
mpa
mode, the legacy scripts are injected into html pages which have no javascript in it.Reproduction
https://stackblitz.com/edit/vitejs-vite-uysirc
Steps to reproduce
Run:
Observe the
dist/blank.html
file. It contains the legacy scripts even though theblank.html
does not have any JS endpoint.System Info
Used Package Manager
npm
Logs
No response
Validations