Skip to content
Boilerplate for creating WordPress plugin UI's with REST API, BrowserSync, Webpack and React
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
server Adding auth code back in Oct 24, 2017
src Removing basic auth mention in readme Oct 26, 2017
.babelrc
.eslintrc
.gitignore
README.md Removing basic auth mention in readme Oct 26, 2017
config.json
package-lock.json Commenting out auth portions. Oct 24, 2017
package.json
webpack.config.js Update extract text loader to work with sass correctly Oct 23, 2017
wp-react-boilerplate.php
yarn.lock

README.md

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/

Getting started

  1. Clone repo to your wp-content/plugins folder
  2. In config.json change the proxyURL to point to your WordPress admin page or plugin page.
  3. In your host WordPress wp-config.php file add define( 'WPRB_AJAX_BASE', 'http://sweetsite.dev/wp-json/wprb/v1' ); and update it to point to your REST API base
  4. Modify any WordPress config in wp-react-boilerplate.php. Rename files/methods/strings as necessary.
  5. Activate the plugin in wp-admin
  6. cd into your checked out folder and run yarn
  7. Run yarn start to get Webpack and BrowserSync running

To build for production run:

yarn build

A production-ready WordPress plugin will be built in the wp-react-boilerplate-built folder.

You can’t perform that action at this time.