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

jerauf's avatar

Deploying Vite to prod

I have shared hosting and need to run npm commands locally. I know this is a basic question, but the documentation isn't clear to me.

What command do I need to run to deploy a Laravel 10 site using Vite to prod? Can't I build the css and js like I'd do with Mix?

0 likes
2 replies
s4muel's avatar

You can, well not exactly deploy, but process and build the css and js. The command to run is npm run build the files are usually put to public folder and a manifest is also generated which contains the "versions" when using asset().

https://laravel.com/docs/10.x/vite#running-vite

1 like
jerauf's avatar

When I do that, though, I get the error:

Unable to locate file in Vite manifest: resources/scss/app.scss

If I change the code from:

@vite(['resources/scss/app.scss', 'resources/js/app.js'])

to

@vite(['resources/css/app.css', 'resources/js/app.js'])

The page appears as if there are no stylesheets.

Please or to participate in this conversation.