@wordpress/create-block: allow to not generate the plugin data (block.json, readme.txt, and plugin header information on the main php file) #23604
Labels
[Tool] Create Block
/packages/create-block
Is your feature request related to a problem? Please describe.
The
@wordpress/create-block
package is meant to create single-block plugins. However it can be easily adapted to also support the creation of blocks for a multi-block plugin.In my case, I have a plugin with a CPT which relies on many custom blocks to input its information. For this case, the single-block plugin would not work. Additionally, since the blocks do not work outside of the CPT, there is no need to expose them in the block directory.
My current workflow to create the blocks for my plugin, located under folder
blocks/
, is the following:blocks/
, runnpm init @wordpress/block block-name
for each blockblock.json
,readme.txt
and the plugin header information from within the main php filerequire
each block's main php file:require block-name/block-name.php
Step 2 above could be avoided, by having
@wordpress/create-block
already not produce these files/code.Describe the solution you'd like
By default, have
@wordpress/create-block
running as currently. However, when executing thenpm init @wordpress/block block-name
command with an additional flag, for instance--autonomous-block
, then adding the plugin information is skipped:block.json
andreadme.txt
are not generatedThis feature request could be tackled together with #23514
The text was updated successfully, but these errors were encountered: