F
Filament12mo ago
Arjen

Convert Filament::registerScripts

Hi, how do I convert the following piece of code from v2 to v3 FilamentAsset? I want to use the compiled code at public/build/assets/app-fdfe8a8c.js (for example) instead of the source in resources/js/app.js
Filament::serving(function () {
Filament::registerScripts([
app(Vite::class)('resources/js/app.js')
], true);
});
Filament::serving(function () {
Filament::registerScripts([
app(Vite::class)('resources/js/app.js')
], true);
});
3 Replies
giuseppemastrodonato
Same issue here. Did you find a way to register vite scripts in v3?
Arjen
ArjenOP11mo ago
@giuseppemastrodonato Sadly no.
awcodes
awcodes11mo ago
FilamentAsset::register([
Js::make(‘custom-js’, Vite::asset(‘resources/js/app.js’))
])
FilamentAsset::register([
Js::make(‘custom-js’, Vite::asset(‘resources/js/app.js’))
])
https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files-from-a-url
Want results from more Discord servers?
Add your server