Oct 22, 2023
0
Level 1
Laravel Vite file versioning not working
Hello! I an using latest Laravel 10 with Vite, but every time I make changes and rebuild it (npm run build), version of files not changed.
My config:
export default defineConfig({
plugins: [
laravel({
input: ['resources/scss/app.scss', 'resources/js/app.js'],
refresh: true,
}),
In my Blade template I call it
@vite(['resources/scss/app.scss', 'resources/js/app.js'])
How to add css and js versioning using Vite? The manual says, that "In build mode, the directive will load your compiled and versioned assets", but every time I get old name of file and client must reload page cache to get new version of assets. Thank you for help!
Please or to participate in this conversation.