Benefit of using the newer Laravel Mix over Elixir
Since Laravel 5.4, the default method to compile assets is using Laravel Mix, instead of elixir. I’ve been messing with it for a few hours, but I cannot see any benefit to this approach over elixir. The documentation didn’t really mention any reason why “Mix” was supposed to be better.
I know that “Mix” uses WebPack by default to compile the assets…. but I can’t see how this is a plus. The Mix also allows you to compile without WebPack, and this always produces files that are smaller in size and work the same.
So if the new method using WebPack always produces larger JS files that do the same thing as the smaller JS files I was making with Elixir, what is the benefit of using Laravel Mix with WebPack?
Sorry, Just trying to understand here :/
So for example, this:
mix.js(source, target);
produces a slightly larger JS file than this:
mix.scripts(source, target);
So what makes the first option better? (since this is the newer, suggested approach)
from Laravel Questions and Answers https://laravelquestions.com/laravel/benefit-of-using-the-newer-laravel-mix-over-elixir/
via Lzo Media
No comments:
Post a Comment