Describe the bug
Const enums used as types in casting disappear from the bundled output in Vite 8.0.13, whereas in Vite 8.0.12 they were still present as regular compiled enums.
not reproduced in rolldown repl directly
Reproduction
https://stackblitz.com/edit/vitejs-vite-kh3ktnpe?file=src%2Fmain.ts
Steps to reproduce
run npm i and npm run dev
System Info
System:
OS: macOS 26.4.1
CPU: (8) arm64 Apple M1 Pro
Memory: 94.25 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.8.0 - /Users/danielwargh/.nvm/versions/node/v24.8.0/bin/node
npm: 11.6.0 - /Users/danielwargh/.nvm/versions/node/v24.8.0/bin/npm
bun: 1.3.14 - /opt/homebrew/bin/bun
Deno: 2.6.5 - /Users/danielwargh/.deno/bin/deno
npmPackages:
@vitejs/plugin-basic-ssl: ^2.3.0 => 2.3.0
@vitejs/plugin-react: ^6.0.1 => 6.0.1
vite: 8.0.13 => 8.0.13
Used Package Manager
bun
Logs
No response
Validations
Describe the bug
Const enums used as types in casting disappear from the bundled output in Vite 8.0.13, whereas in Vite 8.0.12 they were still present as regular compiled enums.
not reproduced in rolldown repl directly
Reproduction
https://stackblitz.com/edit/vitejs-vite-kh3ktnpe?file=src%2Fmain.ts
Steps to reproduce
run
npm iandnpm run devSystem Info
System: OS: macOS 26.4.1 CPU: (8) arm64 Apple M1 Pro Memory: 94.25 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.8.0 - /Users/danielwargh/.nvm/versions/node/v24.8.0/bin/node npm: 11.6.0 - /Users/danielwargh/.nvm/versions/node/v24.8.0/bin/npm bun: 1.3.14 - /opt/homebrew/bin/bun Deno: 2.6.5 - /Users/danielwargh/.deno/bin/deno npmPackages: @vitejs/plugin-basic-ssl: ^2.3.0 => 2.3.0 @vitejs/plugin-react: ^6.0.1 => 6.0.1 vite: 8.0.13 => 8.0.13Used Package Manager
bun
Logs
No response
Validations