Getting Started
Requirements
- WordPress theme environment
- Node.js 22+
- npm
Install Dependencies
Install the Node dependencies from the theme root.
npm installFile:package.json
Production Build
Use the production build when creating optimized theme assets for deployment.
npm run buildCurrent command:cross-env BP_INSTALL=true vite build --mode production
Development Build
Use the development build when debugging compiled assets and sourcemaps.
npm run build:devCurrent command:cross-env BP_INSTALL=true BP_SOURCEMAP=true vite build --mode development
Compile Only
Use compile commands when rebuilding code assets without copying install/font assets.
npm run compilenpm run compile:dev
Use this for: faster rebuilds during development when font/install assets do not need to be recopied.
Watch Mode
Use watch mode during active theme development.
npm run watch
Current command: cross-env BP_INSTALL=false BP_SOURCEMAP=true vite build --mode development --watch
Status: add/restore the size script before documenting this as an active command.
Compiled Output
Compiled assets are written to stable WordPress theme paths under dist/.
dist/js/theme.js– compiled front-end JavaScriptdist/css/theme.css– compiled front-end theme CSSdist/css/admin.css– compiled WordPress admin CSSdist/css/editor.css– compiled block editor CSSdist/font/bootstrap_icons/– copied Bootstrap Icons fontsdist/font/open_sans/– copied Open Sans fonts
Activate the Parent Theme
Install Boilerplate in the WordPress themes directory and activate it from the WordPress admin.
wp-content/themes/boilerplate/Theme file:style.css
Activate a Child Theme
Use a child theme for project-specific customization. The parent theme should remain the stable baseline; the child theme should own project branding, overrides, templates, and configuration changes.
wp-content/themes/boilerplate/wp-content/themes/your-child-theme/
Use this for: client/project customization without editing the parent theme directly.
Basic Workflow
- Install dependencies with
npm install. - Run
npm run buildto generate production assets. - Activate Boilerplate or a Boilerplate child theme in WordPress.
- Use
npm run watchwhile actively developing theme assets. - Use
npm run buildagain before committing or deploying.
Rule of Thumb
Use build for production assets, build:dev for debugging, compile when install assets do not need to be copied, and watch during active development. Keep project-specific work in a child theme whenever possible.