vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.12k stars 6.14k forks source link

issue disable tree-shaking and change variable and function name #13185

Closed wizard2000 closed 1 year ago

wizard2000 commented 1 year ago

Describe the bug

Hi, I'm using Laravel 10 framework. after I run 'npm run build' command, all file compiled and minified but the problem is some my function or variable is deleted in compiled file so in console of browser i'will got 'Uncaught ReferenceError' think because of tree-shaking. also my name of functions will be changed. but in html document I've use the function name for example onchange="change data()" in select box. but the compiled file change the function to 'd' or something else; how can i prevent vite from remove my js function and changing name.

Steps to reproduce

No response

System Info

laravel 10,
vite 4,

Used Package Manager

npm

Logs

No response

Validations

stackblitz[bot] commented 1 year ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.