Repository navigation
Excluding Livewire views from the current full-page-reload behavior #12
|
Greetings, The following are the only versions I managed to get Livewire hot-reloads working with:
And this is how I configured the import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import livewire from '@defstudio/vite-livewire-plugin';
export default defineConfig({
plugins: [
laravel([
'resources/css/app.css',
'resources/js/app.js',
]),
{
name: 'blade',
handleHotUpdate({ file, server }) {
if (
file.endsWith('.blade.php') &&
!file.includes('/livewire/')
) {
server.ws.send({
type: 'full-reload',
path: '*',
});
}
},
},
livewire({
refresh: ['resources/css/app.css', 'resources/js/app.js'],
}),
],
});I had to downgrade them and used Freek's solution because I have no idea about accounting for this in the new versions:
Can you please teach me how? 🙃 |
Replies: 2 comments 6 replies
|
Hi, could you please share the configuration you are trying to set up? |
|
Laravel plugin blade reload conflicts with this plugin, because it calls a full reload during livewire hot reload The reason is that often you have livewire components that include blade components To solve this, the last version of livewire plugin implements an opt-in full reload that adds a small checkbox on the bottom right corner of the page that allows you to switch between livewire hot reload and full page reload (handled by livewire plugin) when a blade file changes So you should disable laravel refresh and enable livewire opt-in refresh by adding an VITE_LIVEWIRE_OPT_IN=true entry in your .env file |
Laravel plugin blade reload conflicts with this plugin, because it calls a full reload during livewire hot reload
The reason is that often you have livewire components that include blade components
To solve this, the last version of livewire plugin implements an opt-in full reload that adds a small checkbox on the bottom right corner of the page that allows you to switch between livewire hot reload and full page reload (handled by livewire plugin) when a blade file changes
So you should disable laravel refresh and enable livewire opt-in refresh by adding an VITE_LIVEWIRE_OPT_IN=true entry in your .env file