laravel-multimix
laravel-multimix copied to clipboard
How to use mix.version()
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.
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">