I am currently working on some custom form components within my Laravel setup (“/packages/forms”). Going with all the examples I can find, there does not seem to be a proper way to watch for file changes like you would with the basic Vite setup.
Filament example:
- https://github.com/filamentphp/filament/blob/3.x/bin/build.js
- Builds all the files within the sub-packages
- dist folder needs to be manually published after each change
Plugin example:
- https://github.com/awcodes/filament-curator/blob/3.x/bin/build.js
- Basically the same issues, just without the sub packages
Issues trying to work with Vite
- Functions for the components are removed during tree shaking, because the usage within the blade file is not noticed: https://github.com/awcodes/filament-curator/blob/3.x/resources/js/curator.js
- When tricking Vite by adding a usage like
window.selectFunction = select
, it’s still missing the requiredexport{n as default};
in the built file (which esbuild adds).
Has anyone managed to have a proper dev setup for Filament package development?