I have prepared my vue3 project with vite. In localhost, if I run npm run dev it is working properly and running the website file. If I run npm run build then it is not working. I have attached the error message as an image. Please check
TIA
In some npm packages, I have used in my project have some features were added from the latest EcmaScript. Like async generator functions, for-await, etc. Vite used the esbuild library to bundle javascript. If we don’t set the target, the transform by esbuild doesn’t work properly. To solve this issue need to set a target in the build command (package.json)
vite build --target=es2020