@raf Your package should either publish its own, already-compiled assets (like Nova); or publish the source files to the application so that the application can build those assets.
How do you handle HMR for a Laravel Package development using Vite
Hello, I am wondering what's the best way to run vite dev-server while source codes and all remains in a separate package directory that is locally installed on a laravel project (symlink). Should that be run from the package path or from installed project path?
If you want to know the details of the issue I am trying to clarify, hope the following explains:
Laravel Demo App: Fresh installation of Laravel app with specific local development package installed with assets published to vendor path on public folder.
Package development (LaravelUiPackage): A separate folder outside the Demo app (../../Packages/LaravelUiPackage) contains the Laravel package that have a resource folder containing js files, basically an Inertia app that gets loaded into blade view file within the package. The package contains its own routes with specific middlewares it requires to run. When installed, the routes and assets load (when vite build is run) as they are updated and published to the demo app public vendor path.
Now if I run the vite command on package directly, and try open the demo app specific route for the package, all loads fine with vite build, but doesn't work for HMR with dev-server mode.
Expectation: When I change frontend component codes, without having to build and publish, I want to see them updated on the demo app while the vite is running with HMR.
Thanks for all the help here.
Please or to participate in this conversation.