Compiling Assets (Mix) | laravel 5.8 webpack
IntroductionLaravelMix[1],apackagedevelopedbyLaracasts[2]creatorJeffreyWay,providesafluentAPIfordefiningwebpack[3]buildstepsforyourLaravelapplicationusingseveralcommonCSSandJavaScriptpre-processors.Inotherwords,MixmakesitacinchtocompileandminifyyourapplicationsCSSandJavaScriptfiles.Throughsimplemethodchaining,youcanfluentlydefineyourassetpipeline.Forexample:mix.js(resources/js/app.js,public/js).postCss(resources/css/app.css,public/css);Ifyouveeverbeenconfusedandoverwhelmedaboutgettingstarted...
IntroductionLaravel Mix[1], a package developed by Laracasts[2] creator Jeffrey Way, provides a fluent API for defining webpack[3] build steps for your Laravel application using several common CSS and JavaScript pre-processors.
In other words, Mix makes it a cinch to compile and minify your applications CSS and JavaScript files. Through simple method chaining, you can fluently define your asset pipeline. For example:
mix.js(resources/js/app.js, public/js)
.postCss(resources/css/app.css, public/css);
If youve ever been confused and overwhelmed about getting started with webpack and asset compilation, you will love Laravel Mix. However, you are not required to use it while developing your application; you are free to use any asset pipeline tool you wish, or even none at all.
{tip} If you need a head start building your application with Laravel and Tailwind CSS[4], check out one of our application starter kits[5].
Installation & ...