After migrating from vite 4 to 5, the code generated in the production environment is different, but there is no problem in the development environment.
Under normal circumstances, the page will not scroll when dragging the box. Currently, the page scrolls when the box is dragged.
By comparing the codes generated in the production environments of vite 5 and 4, we found that vite 5 is missing the "passive" code block.
Describe the bug
After migrating from vite 4 to 5, the code generated in the production environment is different, but there is no problem in the development environment.
Under normal circumstances, the page will not scroll when dragging the box. Currently, the page scrolls when the box is dragged.
By comparing the codes generated in the production environments of vite 5 and 4, we found that vite 5 is missing the "passive" code block.
vite 5 https://stackblitz.com/edit/vitejs-vite-nlrxvr?file=src%2FApp.vue
vite 4 https://stackblitz.com/edit/vitejs-vite-2zqnm1?file=src%2FApp.vue
Reproduction
https://stackblitz.com/edit/vitejs-vite-nlrxvr?file=src%2FApp.vue
Steps to reproduce
npm run build
This sample code only runs properly on mobile devices.
System Info
Used Package Manager
npm
Logs
No response
Validations