Ignore Laravel compiled views for Vite (#6714)

* Ignore Laravel compiled views for Vite

Before testing, run php artisan cache:clear to clear old compiled views.

This issue only happens during local development when running npm run dev.
Laravel continuously recompiles Blade into PHP inside storage/framework/views (especially after Livewire re-renders), and these files are changed by Laravel itself, not by us.

Because of that, Vite thinks we modified a file and triggers a full reload—even though the change is purely internal framework logic. This makes the reload behavior unacceptable and noisy during development.

Since these compiled views belong to Laravel’s backend logic and not frontend assets, Vite does not need to watch them.

Ignoring storage/framework/views keeps Vite stable and prevents reloads caused by Laravel doing its own internal work.

* Vite ignore rule now in one clean line
This commit is contained in:
MUHAMMAD QISTI AMALUDDIN BIN MOHD ROZAINI
2025-11-26 06:16:01 +08:00
committed by GitHub
parent 8500bcc5bd
commit 7663a8ce4c

View File

@@ -10,4 +10,9 @@ export default defineConfig({
}),
tailwindcss(),
],
server: {
watch: {
ignored: ['**/storage/framework/views/**'],
},
},
});