Two options
- Adding
npm run prodto your build script - remove your build files from
.gitignore
If you already deployed and you want to fix that, you can run npm run prod from the commands page on Forge.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I completed the "Build A Voting App" Laracast series, made very minor modifications to customize it for my use case, and deployed it into a production environment using Laravel Forge. I notice the site looks different in production than it does locally, and I fix it locally by running "npm run dev" in Terminal. I tried running "npm run build" using the "Commands" feature of Forge and then I refresh my browser but nothing changes. Do I need to add "npm run build" or something similar to the actual deployment script in Forge or is there another solution? Thanks in advance!
@georgetown74 I'm sorry, I'm really sorry. I was speaking about Laravel Mix commands not Laravel vite.
You were running the right command npm run dev, with vite forget about what I said about npm run prod.
Please or to participate in this conversation.