In my app.blade.php I am using the mix helper to reference the js files:
<!DOCTYPE html>
<html class="bg-gray-100">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="csrf-token" content="{{ csrf_token() }}">
<link rel="shortcut icon" href="/healy-sync.png" type="image/png">
<link href="{{ mix('/css/app.css') }}" rel="stylesheet" />
@routes
<script src="{{ mix('js/manifest.js') }}" defer></script>
<script src="{{ mix('js/vue-vendor.js') }}" defer></script>
<script src="{{ mix('/js/vue-app.js') }}" defer></script>
@inertiaHead
</head>
<body>
@inertia
</body>
</html>
In my webpack.mix.js I have added the version() call:
mix
.js('resources/js/app.js', 'public/js')
.js('resources/js/vue-app.js', 'public/js')
.vue()
.extract(['vue'], 'public/js/vue-vendor.js')
.postCss('resources/css/app.css', 'public/css', [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
])
.css('resources/sso/background.css', 'public/sso')
.css('resources/sso/login.css', 'public/sso')
.css('resources/sso/signin.css', 'public/sso')
.sourceMaps()
.version();
On my prod server, I compile assets with npm run prod
And this works most of the times, but sometimes, I run into cache issues, where somehow a vue-component appears to be not showing correctly. It shows some updated that I coded, but not all. I have to hard refresh the browser and then it works. I really don't understand how these partial updates are even possible.
Is anything wrong with my setup?