AlexanderKim's avatar

Laravel Mix 2.1

Laravel mix executing tasks by ascending order? For example:

mix.js('resources/assets/js/app.js', 'public/js')
   .combine(['public/js/app.js', 'node_modules/owl.carousel/dist/owl.carousel.js'], 'public/js/app.js')

It would first launch js task, then combine it, right? Not like gulp (asynchronous)?

0 likes
3 replies
bobbybouwmann's avatar
Level 88

As far as I know it's ascending order and not asynchronous! At least when you run npm run dev. I believe with npm run watch it will only run the tasks that are connected to a certain file that has changed, but that might be async for speed!

1 like
AlexanderKim's avatar

How would npm run watch work in my case, if i edit only app.js? Because i'm getting unexpected results, when i'm editing app.js and running npm run watch

AlexanderKim's avatar

Loop issue was because i used the same name when combining js files.

Correct way is not using combine at all, i've included my owl carousel file in app.js:

import 'owl.carousel

Please or to participate in this conversation.