https://github.com/barryceelen/wp-gutenberg-hot-module-replacement
An example plugin demonstrating how to use React's hot module replacement while developing a Gutenberg block.
https://github.com/barryceelen/wp-gutenberg-hot-module-replacement
gutenberg-blocks wordpress
Last synced: 4 months ago
JSON representation
An example plugin demonstrating how to use React's hot module replacement while developing a Gutenberg block.
- Host: GitHub
- URL: https://github.com/barryceelen/wp-gutenberg-hot-module-replacement
- Owner: barryceelen
- Created: 2018-10-26T07:20:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-13T22:50:14.000Z (over 3 years ago)
- Last Synced: 2026-01-27T04:36:50.616Z (5 months ago)
- Topics: gutenberg-blocks, wordpress
- Language: JavaScript
- Homepage:
- Size: 666 KB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 17
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# WordPress Gutenberg Hot Module Replacement Example
An example plugin demonstrating how to use React's [hot module replacement](https://webpack.js.org/concepts/hot-module-replacement/) when developing a Gutenberg block. No more death by a thousand ~~cuts~~ reloads. Your command + R keys will thank you.
## Install dependencies and run build script
1. Define the `WP_LOCAL_DEV` constant in your development environment
1. `npm install`: Install plugin dependencies via npm
1. `npm run dev`: Development without hot module replacement, you'll need to reload the page after every change
1. `npm run hot`: Development with hot module replacement
1. `npm run build`: To build the block for use on a production server: