Setting assetsInclude to '**/*.html' breaks build output #16049
Open
Description
Describe the bug
When using assetsInclude: ['**/*.html'], build output contains no javascript in the assets folder (or transpiled typescript) but instead has a index-DUgeDK0c.html
which appears to be the copy as is of index.html
in the root folder. A file named index.html
containing export default "/assets/index-DUgeDK0c.html"
can also be found in the build output
Reproduction
https://stackblitz.com/edit/vitejs-vite-8pmxmj?file=vite.config.js
Steps to reproduce
- Create a vanilla vite project
- Set
assetsInclude: ['**/*.html']
invite.config.js
- Run build
System Info
System:
OS: macOS 14.3.1
CPU: (10) arm64 Apple M2 Pro
Memory: 100.11 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.18.2/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
pnpm: 8.9.2 - ~/.nvm/versions/node/v18.18.2/bin/pnpm
Browsers:
Chrome: 122.0.6261.69
Edge: 122.0.2365.59
Safari: 17.3.1
npmPackages:
vite: ^5.1.4 => 5.1.4
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.