Browse all series
ToolingIntermediate11 episodes

Learn Laravel Mix

Webpack is the most powerful and flexible asset compilation tool available today. With that power, however, comes a certain level of complexity. That's where Laravel Mix steps in. Intended for the 80% usecase, Mix wraps around webpack to make most commonly desired build tasks a cinch to activate.

In this series, as the maintainer of Laravel Mix, I'll teach you everything you need to know - from the basics, to advanced configuration.

Series episodes

Start Compiling Fast

7m 28s

Install dependencies and compile JavaScript and Sass fast with Laravel Mix, get your assets built quickly and confidently.

Decoding Your NPM Scripts

5m 22s

Decode Laravel's NPM scripts (dev, watch, prod) to understand what each command runs and how they trigger your Webpack build.

JavaScript Bundling

12m 46s

Bundle JavaScript with mix.js(): ES2017 compilation, tree shaking, minification, and practical tips to optimize your builds.

The Ins and Outs of CSS Compilation

12m 25s

Compile CSS with Laravel Mix: Sass, Less, Stylus, or PostCSS, learn tooling and workflows to streamline stylesheet builds.

Adding PostCSS Plugins

6m 57s

Add PostCSS plugins with Laravel Mix to layer stylesheet transforms, chain them, optimize CSS, and extend your build workflow.

Automatic Browser Refreshing

3m 23s

Use Mix's built-in Browsersync to auto-reload browsers on asset changes, speed up visual feedback and stop manually refreshing during development.

Cache-Busting Assets

4m 51s

Use mix.version() to append unique hashes to assets and generate mix-manifest.json, enabling reliable cache-busting for fresh files.

Registering Additional Babel Plugins

3m 16s

Learn how to register extra Babel plugins with Laravel Mix, extending preset-env for custom transforms in your build.

Async/Await Support Out of the Box

7m 9s

Laravel Mix 1.7+ adds async/await support, simplifying promise-based workflows for clearer, more synchronous-style build scripts.

Mix Extension Essentials

7m 36s

Learn how to create custom Laravel Mix extensions using its API. Discover two simple ways to extend Mix and enhance your build process with ease.

Build and Deploy a Mix Extension in 15 Minutes

14m 34s

Build and publish a real Laravel Mix extension via npm in 15 minutes - hands-on guide to creating, packaging, and deploying it.

Continue learning

Thumbnail for Learn Redis Through Examples
Learn Redis Through Examples

With Jeffrey Way

  • 7 episodes
  • Intermediate
  • Tooling
Thumbnail for CLI Experiments
CLI Experiments

With Joe Tannenbaum

  • 12 episodes
  • Advanced
  • Tooling
Thumbnail for Laravel API Master Class
Laravel API Master Class

With Jeremy McPeak

  • 24 episodes
  • Advanced
  • Frameworks
Thumbnail for Laravel Explained
Laravel Explained

With Jeffrey Way

  • 9 episodes
  • Advanced
  • Frameworks
Thumbnail for How to Contribute to Open Source
How to Contribute to Open Source

With Luke Downing

  • 13 episodes
  • Intermediate
  • Techniques

Would you like to hear from Laracasts by email occasionally?