Create block templates for different block types
cr0ybot opened this issue · comments
Cory Hughart commented
We have at least 3 different kinds of blocks we create often:
- Static, vanilla JS
- Dynamic, vanilla JS with PHP render on front-end
- ACF, new formula that uses block.json
Ideally, we could create templates for these 3 block types and put them somewhere in the scaffolding that could then be utilized by an npm command to scaffold a block.
Something like:
npx @wordpress/create-block --template ./path/to/template-directory --no-plugin
We should be able to add the command to scripts
in package.json in order to point to the correct template path and block src path.
See https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/