DEF STUDIO srl

Watching files for hot reload trigger

by default livewire() plugin will trigger hot reload when a .blade.php file changes in resources/views/** folders or a .php file changes in app/**/Livewire/**, app/**/Filament/** or app/View/Components/** folders.

if you wish to add/change this behavior (because you have livewire files in other locations), this can be achieved using the watch config:

// vite.config.js 

import livewire, {defaultWatches} from '@defstudio/vite-livewire-plugin';

export default defineConfig({
    //...
    
    plugins: [
        //...
        
        livewire({
            refresh: ['resources/css/app.css'],
            watch: [
                ...defaultWatches,
                '**/domains/**/Livewire/**/*.php',
            ]
        }),
    ],
});
Suggest a change
Last updated 03 December 2024