Laravel Mix (v6.0.49 stable) is a webpack wrapper providing a clean, fluent API for defining build steps. It simplifies asset compilation for CSS/JS pre-processors in Laravel and other PHP projects. Key differentiators: zero-config setup, automatic versioning, vendor extraction, and support for Vue, React, SASS, Less, PostCSS, TypeScript, and more. Currently on v6 with webpack 5 support; active development with regular minor releases.
npm install laravel-mixVerified import paths — ran on the pinned version, not inferred.
Basic setup: compile JS and SASS, enable versioning in production.
Review upgrade guide at https://github.com/JeffreyWay/laravel-mix/blob/master/UPGRADE.md
Replace mix.extract() with mix.extractVendor() or custom splitting.
Use require() in webpack.mix.js; avoid import/export unless transpiled by Mix itself.
Use const mix = require('laravel-mix'); do not import submodules directly.Ensure const mix = require('laravel-mix'); is the first line of webpack.mix.js.Update postcss to ^8.3.11 (peer dependency of laravel-mix v6).