RPeraltaJr
8/19/2019 - 9:26 PM

Versioning Your Assets (to force clear cache)

const mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .version();
<link href="{{ mix('css/app.css') }}" rel="stylesheet" type="text/css" />
{
    "/js/app.js": "/js/app.js?id=c40c1ff08a7aea153d07",
    "/css/app.css": "/css/app.css?id=864742dbc29a6d93d913"
}