laravel-multimix icon indicating copy to clipboard operation
laravel-multimix copied to clipboard

How to use mix.version()

Open hfalucas opened this issue 7 years ago • 1 comments

Is it possible to use the versioning option with this package? I have tried but the mix-manifest.json only gets the paths of the last npm mix executed command.

hfalucas avatar May 16 '18 13:05 hfalucas

It is. I am using this to build a seperate css file and mix file for each theme in resources/assets/sass/:

mix.sass(`resources/assets/sass/${MIX_PACKAGE}.scss`, `css`)
    .setPublicPath(`public/${MIX_PACKAGE}`)
    .sourceMaps()
    .disableNotifications();

if (mix.inProduction) {
  mix.version();
}

and run it using

npm run mix production footheme

This builds the files /public/footheme/css/footheme.css and and /public/footheme/mix-manifest.json

It is important to include the folder for the mix-manifest.json file in the mix() function in your php / blade file.

e.g.:

<link href="{{ mix('footheme.css', 'footheme') }}" rel="stylesheet">

thijsvdanker avatar Nov 05 '18 11:11 thijsvdanker