I'm curious to know if I really need to run npm run build on the production server? Because this requires me to have npm installed on the production server.
If I remember correctly, this wasn't the case with assets produced by MIX. Can someone clarify?
I think it should be possible to build it locally and commit it to git. But be aware that your urls might be wrong. I haven't tested it myself as I build on production, but you might need to set this in your env before building (to the production url)
@thebigk Personally I have installed it yes. I use zero downtime deployment to avoid downtime (ploi.io). I assume some people build it in their CI pipeline instead.
I use Forge. But I had to include npm run build in my deployment script. Was wondering if that's the right way to do it or I missed something in the documentation.
@thebigk I do the same with ploi. Just be sure that you either take the site down with a maintenance message or use zero downtime deployment. Vite deletes all the js/css files before generating new ones, so your site will be broken while it is building, unless you do one of those.