Custom Gutenberg Block
This is a basic custom Gutenberg block. Files explained below.
block.js
— We register Custom Gutenberg block here.editor.css
_ Block CSS for the editor.style.css
— Block CSS for the front end.index.php
— Enqueue block's assets for the editor and the front end..babelrc
— Babel custom configuration..gitignore
— Git ignore file to ignore node_modules and such other files.package.json
&package-lock.json
— NPM related file for holding NPM related metadata andbuild
/dev
NPM scripts.webpack.config.js
— Webpack configuration file.
Getting Started!
Read the files explained above. All of the files are heavily inline documented. All you have to do is following:
- Run
npm install
- To watch and build run
npm run dev
- To build for production run
npm run build