Good question. I haven't tried passing anything in. I just call version() and everything seems to work out fine. Mix versions everything in their current directory so no more build directory.
Jan 24, 2017
18
Level 8
Using Mix to version combined files
I'm trying to convert my old gulpfile.js to be compatible with Mix and 5.4. Things went pretty smoothly until I got to versioning. My webpack.mix.js looks like this:
mix.js([
'resources/assets/js/bootstrap.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/rangetouch/dist/rangetouch.js',
'node_modules/select2/dist/js/select2.full.js',
'node_modules/spectrum-colorpicker/spectrum.js',
'node_modules/flatpickr/dist/flatpickr.js',
'resources/assets/js/app.js',
], 'public/js/app.js')
.less('resources/assets/less/app.less', '../resources/assets/build/app.css')
.combine([
'resources/assets/build/app.css',
'node_modules/font-awesome/css/font-awesome.css',
'node_modules/select2/dist/css/select2.css',
'node_modules/plyr/dist/plyr.css',
'node_modules/spectrum-colorpicker/spectrum.css',
'node_modules/flatpickr/dist/flatpickr.css',
'node_modules/flatpickr/dist/themes/airbnb.css'
], 'public/css/app.css')
.version([
'public/css/app.css',
'public/js/app.js'
]);
What I expect to happen is:
- All JS files get combined into
public/js/app.js - One less file gets processed into
resources/assets/build/app.css - All CSS files (including the one from #2) are combined into
public/css/app.css -
public/css/app.cssandpublic/js/app.jsget versioned.
In reality, the first 3 steps go fine, but when it comes to version the CSS file - it doesn't. Instead it versions resources/assets/build/app.css. Can you not pass in an array of things to get versioned like you could with gulpfile.js?
Level 9
Jeffrey closed an issue over at Github explaining this behavior:
https://github.com/JeffreyWay/laravel-mix/issues/211#issuecomment-276095424
1 like
Please or to participate in this conversation.