Laravel Mix

I’ve used Laravel Mix for couple of projects and its been amazing how easily it can be molde as per requirement, for example when you use Laravel-Mix for single page app for wordpress theme or for huge application with couple of themes and with large application with different manifest files or single manifest file for all themes etc


First thing to decide when to use Gulp, Webpack (Laravel-Mix)?

it’s easy to decide to use gulp as task runner and Webpack for assets compiling as explained in detail in this article.

Code Splitting & Dynamic Component Loading

Passing argument

Optimize Laravel Mix for 50 plus themes

Laravel Mix Extension to merge

When you want to have multiple entry points

Automatic Build Process for Application Setup with Laravel Valet, Gulp and Laravel Mix

Modules Used

var cmd = require('node-cmd');
var gulp = require('gulp');
const fs = require('fs');
var shell = require('shelljs');
var silentState = shell.config.silent;
shell.config.silent = true;
shell.config.async = false;
var tld;

* Update domain for laravel valet
* */
function setModuleDomain(module_dir_name) {
    tld = shell.exec('valet domain', '-n').stdout.replace("n", '');
    shell.sed('-i', 'VALET_DOMAIN', tld, '.env');

* Admin Setup
* */
gulp.task('admin', async function() {
    // - Setp 1 - IM Core Application
    shell.exec('git clone;');'FOLDER NAME');
    shell.exec('composer install; php artisan migrate; npm install; valet link {FOLDER NAME Without tld}; valet link {FOLDER NAME Without tld}; valet links secure {FOLDER NAME Without tld};');'..');
    shell.echo('App setup complete.');
    shell.echo('domains setup complete');

* Setup Frontend or Other Application Modules
* */

* Task Runner - Gulp
* */
gulp.task('default',  gulp.series('admin', 'otherTasks'), function(){
    shell.echo('Application Modules setup complete');