Running mix for multiple javascript files I want to compile multiple JS files using Laravel Mix and also make them generate as separated files. Right now they are all combined and I want them separated. This is my mix file
mix.js(['resources/assets/js/admin.js', 'resources/assets/js/frontend.js'], 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
Thanks
You can run multiple .js calls on the mix variable. That way they will be generated separately.
mix.js('resources/assets/js/admin.js', 'public/js')
.js('resources/assets/js/frontend.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
Let me know if that works for you!
@bobbybouwmann Wooooww! That's perfect! Thank you for the great help again!
But how to extract admin and frotned libraries to different vendor files? I wouldn't want to load the admin lbraries in the frontend...
@timo.heil Have you found a solution for this? (i.e to extract admin and frontend libraries to different vendor files)
Hi all,
Same kind of bugs here.
Have you found any solutions or tricks for this ?
When I build the assets separatly (run JS / run SCSS) I get correct files, but when both run together, CSS files are empty.
Get last version of laravel-mix (5.0.1), wepack (4.42.0) (and pretty much all packages' last versions).
I have import in SCSS files, and load dynamic vue-js component in JS files.
Any idea ?
Please sign in or create an account to participate in this conversation.