Bug in Laravel 6? Laravel mix version working locally but not in remote
Hello,
I am having a weird issue, when I try to version my app.js and custom.css it works locally(even when compiled in production), but as soon as I upload all the files form the public folder to my public_html in the remote, the versionining of the files do not working.
"laravel/framework": "6.2",
"laravel-mix": "^5.0.5",
Here is what I tried:
webpack:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.styles(['resources/css/custom.css'], 'public/css/custom.css');
if (mix.inProduction()) {
mix.version();
}
Also tried this:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.styles(['resources/css/custom.css'], 'public/css/custom.css');
mix.version();
In my blade files:
I tried:
<script src="{{ asset(mix('css/custom.css')) }}"></script>
<script src="{{ asset(mix('js/app.js')) }}"></script>
and
<script src="{{ mix('css/custom.css') }}"></script>
<script src="{{ mix('js/app.js') }}"></script>
As I said it is working on my local but not on the production server.
I compile everything locally and upload all to the remote.
Is there a file on the local that is needed on the remote for this to work correctly please?
Thank you.
In my case I accidentally uploaded public/hot file to production, so the public/mix-manifest.json was ignored when calling mix function in script tag.
<script src="{{ mix('js/app.js') }}"></script>
Please or to participate in this conversation.