Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 780 Bytes

README.md

File metadata and controls

11 lines (9 loc) · 780 Bytes

Demonstration of how to use wordpress-shortcode-webpack-plugin with Create React App, using react-app-rewired to extend the CRA webpack config.

How I got here:

  1. npx create-react-app my-plugin
  2. cd my-plugin
  3. yarn add -D react-app-rewired wordpress-shortcode-webpack-plugin
  4. Created config-overrides.js adding the webpack plugin.
  5. Updated package.json to use react-app-rewired instead of react-scripts.
  6. (Bonus) Updated base URL to be correctly pathed for Wordpress by setting "homepage": "/wp-content/plugins/my-plugin/assets/" in package.json.
  7. Run yarn build. Done!