WP React Boilerplate
Sample WordPress plugin for setting up a project with Yarn, Webpack, BrowserSync and React. Tailored to creating a wp-admin page, but completely flexible and can be used for themes as well.
Companion blog post: https://deliciousbrains.com/develop-wordpress-plugin-webpack-3-react/
- Clone repo to your
proxyURLto point to your WordPress admin page or plugin page.
- In your host WordPress
define( 'WPRB_AJAX_BASE', 'http://sweetsite.dev/wp-json/wprb/v1' );and update it to point to your REST API base
- Modify any WordPress config in
wp-react-boilerplate.php. Rename files/methods/strings as necessary.
- Activate the plugin in wp-admin
cdinto your checked out folder and run
yarn startto get Webpack and BrowserSync running
To build for production run:
A production-ready WordPress plugin will be built in the