From 974d951b3fcca1dcaf623e9f73d47cb703489fb2 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Wed, 29 Jan 2025 14:30:55 -0600 Subject: [PATCH] Add Laravel Mix introduction --- console/asset-compilation-mix.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/console/asset-compilation-mix.md b/console/asset-compilation-mix.md index 5069bf36..f34ff020 100644 --- a/console/asset-compilation-mix.md +++ b/console/asset-compilation-mix.md @@ -1,5 +1,20 @@ # Asset Compilation - Mix +## Introduction + +[Laravel Mix](https://laravel-mix.com/) provides a fluent API for defining webpack build steps for your Winter CMS application using several common CSS and JavaScript pre-processors. + +In other words, Mix makes it a cinch to compile and minify your application's CSS and JavaScript files. Through simple method chaining, you can fluently define your asset pipeline. For example: + +```js +mix.js('resources/js/app.js', 'public/js') + .postCss('resources/css/app.css', 'public/css'); +``` + +If you've 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. + +Winter integrates seamlessly with Mix by integrating support for [Laravel's integration](https://laravel.com/docs/8.x/mix) and providing several console commands ([`mix:create`](#automatic-mix-configuration), [`mix:install`](#install-node-dependencies), [`mix:list`](#list-registered-mix-packages), [`mix:compile`](#compile-a-mix-packages), and [`mix:watch`](#watch-a-mix-package)) for development. + By default, any plugin or theme containing a `winter.mix.js` file at its root will be automatically registered. Registered items can be viewed with the `mix:list` command.