There are many suggestions online to use the heroku-buildpack-static .
The problem with this is that it is deprecated and will not work with the latest heroku stacks.
In their readme file they suggest to use an NGINX buildpack, but it looks like an error prone process.
I have figured other another way just by using the heroku/nodejs build pack
You can start by setting the heroku/nodejs in your application
heroku buildpacks:set heroku/nodejs -a my_application
In principle we just want to run tsc && vite build && vite preview
but there are some caveats.