Laravel Mix – Basic Concepts

web mobile development coding

WHAT

Laravel Mix provides a fluent API for defining Webpack build steps.

Home : https://laravel.com/docs/7.x/mix
Source : https://github.com/JeffreyWay/laravel-mix
Documentation : https://laravel-mix.com/docs/5.0/basic-example

https://github.com/JeffreyWay/laravel-mix

Q : What is webpack ?
A : Webpack is a module bundler and also capable of transforming, bundling, or packaging just about any resource or asset
Source : http://github.com/webpack/webpack
More : https://webpack.js.org/

WHY

First, why the need of webpack ?
Very well explained in link below
https://webpack.js.org/concepts/why-webpack

Next, why the need of laravel-mix ?
Short answer : Simplicity over complexity
Laravel mix provides simple wrappers around webpack to provide default configs to hide multiple configs of webpack.
Example :
https://laravel-mix.com/docs/5.0/mixjs
With a single line of code, Laravel Mix allows you to trigger a number of vital actions.