Closed JGlueck-WIKA closed 2 months ago
Browsers should follow redirects so you could point data-livewire-asset-uri
to a custom route.
Route::get('livewire-asset', function(){
// Get public/build/manifest.json contents
// Lookup the "resources/js/livewire.js" key
// Read the "file"
// return redirect()->to($file);
});
This should ensure the correct version is loaded.
Thanks for the tip Philo, that should certainly work. 🙂
I'd like to manually bundle Livewire and Alpine so that I can use a 3rd-party Alpine plugin. This works perfectly well with wire-extender when I set the
data-livewire-asset-uri
attribute on the<script>
tag that referenceswire-extender.js
to the custom JS.The problem is, that Vite will always append a randomish string to the filename in order to bust the client cache (which is great). However, this makes it impossible to determine the correct file name in a production scenario outside of my app.
Does someone have a tip for me how I can achieve that? My first idea was that it would be great if there was a backend-side configuration possibility to point to the
data-livewire-asset-uri
, but I'm not sure if this is possible and maybe there's a simpler solution anyhow.