F
Filament14mo ago
bflip

Vite not refreshing dashboard views

Refreshes and compiles on the welcome.blade.php. Doesn't refresh on inner filament pages. Won't compile tailwind classes on livewire components either. I am stumped!
import {defineConfig} from 'vite'
import laravel, {refreshPaths} from 'laravel-vite-plugin'

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: [
...refreshPaths,
'app/Filament/**',
'app/Forms/Components/**',
'app/Livewire/**',
'app/Infolists/Components/**',
'app/Providers/Filament/**',
'app/Tables/Columns/**',
'resources/views/**',
'resources/views/livewire**',
],
}),
],
})
import {defineConfig} from 'vite'
import laravel, {refreshPaths} from 'laravel-vite-plugin'

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: [
...refreshPaths,
'app/Filament/**',
'app/Forms/Components/**',
'app/Livewire/**',
'app/Infolists/Components/**',
'app/Providers/Filament/**',
'app/Tables/Columns/**',
'resources/views/**',
'resources/views/livewire**',
],
}),
],
})
Solution:
Filament::registerRenderHook('panels::head.end', fn(): string => Blade::render('@vite ( [\'resources/css/app.css\',\'resources/js/app.js\'])'));
Filament::registerRenderHook('panels::head.end', fn(): string => Blade::render('@vite ( [\'resources/css/app.css\',\'resources/js/app.js\'])'));
Jump to solution
2 Replies
bflip
bflipOP14mo ago
I am just so confused. It sees changes from a livewire component, but it doesn't compile CSS classes. Nor does it refresh the dashboard page - it refreshes the home page instead. Any ideas? Even filamentPHP custom pages aren't compiling new tailwind classes. Added @vite('resources/css/app.css') to the base.blade.php file. Why wouldn't that be included by FilamentPHP dashboard? It's a TALL stack dashboard that doesn't let you use/compile tailwind classes in custom page views by default?? I'm so confused. Am I missing a standard way of making a custom page with tw classes? I found this old V2 way, but not sure how to do it in V3?
Filament::serving(function () {
Filament::pushMeta([
(new Vite)(['resources/css/custom.css'])
]);
});
Filament::serving(function () {
Filament::pushMeta([
(new Vite)(['resources/css/custom.css'])
]);
});
Solution
bflip
bflip14mo ago
Filament::registerRenderHook('panels::head.end', fn(): string => Blade::render('@vite ( [\'resources/css/app.css\',\'resources/js/app.js\'])'));
Filament::registerRenderHook('panels::head.end', fn(): string => Blade::render('@vite ( [\'resources/css/app.css\',\'resources/js/app.js\'])'));
Want results from more Discord servers?
Add your server