Hot Reloading when using admin panel
Is there away to get vite hot reloading working with the admin panel.
As i am not using views and doing changes inside the Helper files i cant seem to get hot reloading with vite working @Dan Harrin
9 Replies
please dont @ me, be patient. i dont know the answer.
Ok sorry about that Dan, I think i know the reason is that filament doesnt use the normal @vite to load the app.css and app.js, so reloading in filament doesnt work
its more likely that someone else will be able to help if you send the code you're using
Hi i actually just this second got it working but i had to add
@vite(['resources/css/app.css', 'resources/js/app.js'])
to the base.blade.php file in order for vite to work properly with hot reloading.
I dont really want to use the views as i am doing everything in the resource, but i suppose i can delete the views after development.
@Dan Harrin (last mention i promise just as i am replying! )
An example here https://filamentphp.com/docs/2.x/forms/installation#vite
You may add the filament directory
Filament
Installation - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
For anyone else with this issue this is how i solved it finally (I am using Valet as a note)
vite.config file
I then published filament views and deleted all of them (I am using the admin panel) except resources/views/vendor/filament/components/layouts/base.blade.php
on that file i added
just before
then finally on app.js added this
As i was using livewire vite plugin to preserve state on livewire components. (which is still a bit flakey!)
Main thing though is hot reload works
internally,
@vite(...)
compiles to (app(Vite::class)(...))
and we do that in the filament core
so i dont know how its any differentThanks Leandro, I got it with the livewire plugin for vite (it does filament and livewire files by default π ) Thanks though!
Not sure it was only way i could get it to work though Dan
Oh I am also using Stancl multi tenancy so that "may?"be a factor
maybe look into how the html is different in the dom