How to put Filament assets together with Vite assets?

Hello, I am new to fillament. I will appreciate your help. I want to achieve a single command build, because I have both php artisan filament:assets and vite. I am with clean installation of Laravel and Filament and I am settuping an application. When I publish the assets by running php artisan filament:assets they go the public/ directory. I also have assets defined in vite.config.js from the resources/ directory. In architecrtural perspective, how can I combine the assets and run only one command for the build (I need dev and prod build)? I am not sure if this is the correct approach, so I would ask for more advanced aproach if there is any. Sincerely, Manol.
5 Replies
Dennis Koch
Dennis Koch14mo ago
Why not just run both? a filament:assets && npm run build
Manol T.
Manol T.OP14mo ago
It is kind of strange for me to have 2 commands for build and initially I thought it is the incorrect way. Would you tell me about the filament published assets in public/ - is the intention to include it in a blade template or the idea is to put it into the vite build?
torriv
torriv14mo ago
I have a Make file to combine those into one command. So the only thing i need to do is write:
make build
make build
Dennis Koch
Dennis Koch14mo ago
Why don't you just bundle both commands in a npm or composer script? They are included by Filament
Manol T.
Manol T.OP14mo ago
Okay, I will proceed like that Thak you!
Want results from more Discord servers?
Add your server