Build Tooling
Location
All Node tooling lives in configs/.
That folder contains:
package.json- webpack configuration
- build scripts
- installed Node dependencies
This is intentional. ReactWP keeps:
- source code in
src/ - generated WordPress output in
dist/ - build logic in
configs/
Main Commands
Run these commands from configs/:
npm run build
npm run build:themes
npm run build:plugins
npm run build:mu-plugins
npm run watch
npm run prod
npm run get:core
More focused commands also exist:
npm run build:themes:js
npm run build:themes:css
npm run watch:themes
npm run watch:themes:js
npm run watch:themes:css
npm run prod:themes
What Each Command Does
buildruns the project pipeline in development modewatchkeeps themes, plugins, and mu-plugins rebuilding as files changeprodruns production builds with JS minification, CSS compression, and copied theme image optimizationget:corerefreshes WordPress core insidedist/
The project pipeline delegates work to smaller scripts, mainly:
scripts/project-pipeline.mjsscripts/theme-pipeline.mjsscripts/build-theme-styles.mjs
Theme JS And Theme CSS Are Separate
The default theme does not rely only on style injection from JavaScript.
Theme CSS is compiled separately from:
src/themes/reactwp/scss/default.scss
into:
dist/wp-content/themes/reactwp/assets/css/reactwp.min.css
This matters because:
- CSS becomes a real cacheable asset
- the theme can ship critical shell styles in PHP and the rest in compiled CSS
- theme JS and theme CSS can be watched or built independently
Shared Webpack Config
webpack.shared.config.js is the base factory used by:
webpack.themes.config.jswebpack.plugins.config.jswebpack.mu-plugins.config.js
It centralizes:
- JS and JSX compilation
- asset output structure
- template folder copying
- shared alias and resolve behavior
- production optimization rules
The target-specific config files still exist so themes, plugins, and mu-plugins remain easy to reason about separately.
Build Output
The tooling writes generated files into the WordPress structure inside dist/.
In practice:
- theme PHP templates are copied into
dist/wp-content/themes/... - bundled JS and asset files are emitted into
assets/ - copied theme media stays in matching
assets/fonts,assets/images,assets/videos,assets/audios, orassets/othersfolders - plugins and mu-plugins are copied into their WordPress destinations
get:core
npm run get:core downloads and refreshes the WordPress install in dist/.
It also refreshes the bundled ACF PRO copy by default.
Useful environment flags:
REACTWP_WORDPRESS_URLto override the WordPress ZIP URLREACTWP_ACF_URLto override the ACF ZIP URLREACTWP_SKIP_ACF=1to skip the ACF download