0.0.2 • Published 4 years ago
mill3-wp-boilerplate v0.0.2
MILL3 Wordpress Theme Boilerplate
Our WP theme boilerplate using Timber/Twig templates
Requirements
- npm / yarn
- Timber WP plugin
How to use for local development
Edit wp-config.php
and add this constant :
define('THEME_DEV', true);
Make sure the name line in package.json
matches your theme's directory name.
{
"name": "mill3-wp-boilerplate",
"version": "2.0.0"
...
/wp-content/themes/mill3-wp-boilerplate/
Install all node requirements :
npm install
Run the install script to find and replace the theme domain name and namespace
node install.js --domain="mytheme" --namespace="MyTheme"
Then start Webpack
npm run dev
Production assets build
Simply run :
npm run build
Then Git add everything in dist/*
directory.
In production mode, assets are loaded from dist/assets.json file, cache busting included !
Prettier/ESLint
You can ESLint your code with the following command :
npm run lint
And Prettier formatting :
npm run prettier
Please also note that there's a pre-commit hook using pretty-quick which can be disabled in package.json
.
0.0.2
4 years ago