The SitePoint PHP blog has posted a new tutorial for those developers out there that like the idea of the Laravel Mix functionality for defining Webpack builds but aren't using the rest of the framework for their application.
If you, like me, just want to get up and running on a project as quickly as possible, you probably don’t want to spend time configuring build tools like Webpack. Laravel Mix solves this problem, and makes asset compiling incredibly easy, but what if you want to use it on a non-Laravel project? This article shows you how to accomplish that.[...] Laravel Mix, formerly Elixir, could be defined as an API wrapper for Webpack. It has a fluent syntax and is generally easy to use. Setting up versioning, hot reloading, and asset building/compiling is a breeze and requires only a single configuration file and a few lines of code.
The post starts off with the requirements you'll need to create the build - besides the Mix code, naturally (NPM and Node). He includes the commands to get the required packages installed and how to create the initial Webpack "mix" file. They then add a few packages to be installed, create assets to be compiled and run the tool to perform the actual build. There's also a section about "cache busting" and, finally, setting up a local index file to test out the result. The tutorial ends with a few other helpful commands you might want to use during your development.