Build optimization breaks code (Removes necessary break
from switch
)
#12794
Labels
bug: upstream
Bug in a dependency of Vite
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
Build optimization is removing
break
keyword fromswitch
statement where it shouldn't.I'm not sure if this is a Vite, Rollup or Typescript issue.
Reproduction
https://github.com/DeepDoge/vite-breaks-switch/blob/master/src/main.ts
Steps to reproduce
npm i
npm run dev
npm run build
npm run preview
System Info
System: OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye) CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz Memory: 5.93 GB / 15.44 GB Container: Yes Shell: 5.1.4 - /bin/bash Binaries: Node: 18.14.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.3.1 - /usr/local/bin/npm npmPackages: vite: ^4.2.0 => 4.2.1
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: