Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

huwfulcher's avatar

Laravel 9 Production Deployment

Hi all,

Fairly new to Laravel and trying to figure something out. I'm using Laravel 9 with Vite for asset bundling. When deploying an update to my production server do I need to be running npm run prod or npm run build? At the moment there isn't an alias for npm run prod in my package.json which makes me think this was an old way of bundling production assets?

Overall I'm struggling to figure out what needs to be done every time a new deployment happens. Any pointers would be appreciated, thanks!

0 likes
2 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Yeah that is the old name. It is now npm run build. You need to run this if there are any changes to css or js on every deploy. You can either run it on production (with a bit of downtime while it runs) or locally and then commit the files it compiles in /public/build, to git and push them to production

1 like

Please or to participate in this conversation.