I commit both the compiled minified and regular versions to git. In the master template it checks to see if it's production, and loads minified versions, otherwise it uses regular versions.
I version them with mix, so you need to include the /public/mix-manifest.json file in your repo as well and then just use <script src="{{ mix('/js/file.js') }}"></script> and in the browser it outputs the versioned file with the cache-busting querystring (/js/file.js?laksjwerlkjasaslkjf)
There are a lot of ways to do this, but that's what I usually do.
Imagine your diffs if your entire compiled js and css were in version control?
For me, only the uncompiled assets are in version control; the compiled versions are artefacts of a build process which can be handled during deployment.
@Cronix: But does that not blow up your git repo in any way? As mentioned before, unminified e.g. vendor.js begome often more than 2-3 MB big? Is there any way to name the mainfest file?
@tykus I never open the compiled files still less diff them. I have the source files e.g. written in typescript and just version them yet.
How do you put your artifacts then to your app ? by hand via ssh?
Yeah, I did try compile all assets via forge on the server as well. But some servers are too weak to let me run mix on it (insufficient memory).
Further I have to deploy on some shared hoster's server, where I can connect via SSH but can't use node because it isn't installed (And I'm not permitted to install it).
I think I go the Way with the .min. files are added to git and the other ones aren't. I never diffed compiled files yet, so that doesn't matter for me. And it doesn't take to much space.
I also thought about wrapping the mix helper with something like mix_env where it does rewrite the files to the filename.min.js pattern. But this must prove itself first.