index.html without JS breaks multi-page app setup linking to the same stylesheet #13436
Description
Describe the bug
There are two entry points (index.html and nojs.html). Both of them link to the same CSS stylesheet. There is an import for import"./nojs-ab7f0fe6.js";
in the generated main output, importing a file that doesn't exists in the dist folder.
Note: Originally as #13426. Starting a new issue with a simplified reproduction.
Reproduction
https://stackblitz.com/edit/vitejs-vite-uhnk5n
Steps to reproduce
npm install
npm run build
System Info
StackBlitz
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.