I enjoy working with Sage 11 and Vite, especially with Vite::content() and Vite::asset() to load the compiled files from public/build. I now want to use the setup as a plugin, so I copied the theme and adjusted a few parts. However, Vite::asset() still resolves the theme path instead of the plugin path, and I can’t figure out why. Which configuration or piece of logic am I missing? Did I overlook any documentation? What alternatives do I have? Thanks for any help.
I expected that I can change this here. From this:
Application::configure()
->withProviders( [
App\Providers\ThemeServiceProvider::class,
] )
->boot();
to this:
Application::configure( plugin_dir_path( __FILE__ ) )
->withProviders( [
App\Providers\ThemeServiceProvider::class,
] )
->boot();