Are you leaving the npm run dev command running?
See also https://laracasts.com/discuss/channels/vite/equivalent-of-vite-watch
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Recently started a fresh new laravel project and noticed that mix got replaced with vite. Now i have everything setup with vite, i also added Tailwind CSS and Alpine JS.
The issue is that when i run the "npm run dev" command, it all works and pages also reload automatically (using purely blade files), but when i change a tailwind class like a background to another color, the page refreshes and i can see in the page source that the class has changed, but visually it reverts back to default color.
When i go to inspect the element the new background color class is also not to be found in the styles list.
Am i missing something somewhere? I have no idea where to look atm.
@Therin Ah Vite will only work with one nested directory; any more, it will unfortunately break.
So ./app/nested/*.blade.php will work. However ./app/nested/nested/*.blade.php won't work. It's the same when using React or Vue with dynamic imports.
I hope that helps. If my comment has helped, please could you mark it as the best answer so it can help others :)
Please or to participate in this conversation.