Skip to content

Instantly share code, notes, and snippets.

@ibnuh
Created May 25, 2018 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibnuh/9aa5805c14add72c510cc4948f4f6a1e to your computer and use it in GitHub Desktop.
Save ibnuh/9aa5805c14add72c510cc4948f4f6a1e to your computer and use it in GitHub Desktop.
Laravel mix wildcard workaround
let mix = require('laravel-mix');
let fs = require('fs');
// Your bunch of js folders
let componentsFolder = 'resources/assets/js/manage/components/';
// Get all js inside the folder
let components = fs.readdirSync(componentsFolder);
// run laravel mix for each js
components.forEach(component => {
mix.js(componentsFolder + component, 'public/js/manage/components/' + component);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment