A simple way to develop WordPress gutenberg blocks
This plugin provides easy way to develop WordPress gutenberg blocks.
Plugin comes ready with hot reload and code splitting so that you don't have to worry about plugin slowing down the Gutenberg block.
Note: I have used npm 10.16.0 during development
How to Install the plugin?
- Clone the repository in your
wp-contents/plugins
folder
git clone git@github.com:sudheer-ranga/develop-guten-blocks.git
Replace all the instances that says dbg
to what ever you want to name your plugin.
- Install the dependencies
npm install
- Watch for changes
npm start
-
Create a folder in
src/blocks
with your custom block name. -
Copy the
edit
andsave
folders that is present insay-hello
block and change it according to your needs.
The static block has an example implementation for RichText block
-
Run
npm run build
-
In the
plugin.php
file, comment those lines that points tohttp://localhost:8000
and uncomment this lineplugins_url( 'build/'[filename], __FILE__ )