This is the library for common Gutenberg blocks, which will be primarily, if not solely, used inside the plugin for development and production use.
npm install common-gutenberg-blocksThis is the library for common Gutenberg blocks, which will be primarily, if not solely, used inside the plugin for development and production use.
Importing during development
``js
import * as blocks from './blocks'
for (const [name, component] of Object.entries(blocks)) {
registerBlockType(
component.name, {
title: component.title,
attributes: component.attributes,
category: component.category,
edit: component.edit,
save: component.save,
},
)
}
`
The change in production
`js``
import * as blocks from 'common-gutenberg-blocks'