A minimalistic boilerplate for build WordPress themes using Laravel Mix.
- Clone into an empty theme directory
cd
into your new theme directory- Run
npm install
- Open up the
webpack.mix.js
file and replacehttp://localhost/
with your local development hostname- This will allow you to use live reload/injection while working on your CSS/JS
Run npm run dev
Assets will be compiled and BrowserSync will proxy the dev host allowing you to work while seeing your CSS and JS changes appear on the site as they are recompiled.
Run npm run prod
This will prepare versioned assets and sourcemaps for your CSS and JS files.
Versioned assets will appear in a build
directory alongside a manifest file which is used while
enqueuing scripts and styles.