Skip to content

Setting assetsInclude to '**/*.html' breaks build output #16049

Open
@andreademasi

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

  1. Create a vanilla vite project
  2. Set assetsInclude: ['**/*.html'] in vite.config.js
  3. 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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions