I am using block.json in a WordPress theme for each block withhin but the editorScript is referencing the plugins directory and not the theme.
I am using block.json in a WordPress theme for each block withhin but the editorScript is referencing the plugins directory and not the theme.
2
Answers
For themes, you should use theme.json, the newly embraced practice for defining properties for the block editor. Part of theme.json provides for individual blocks and the contents are what you are using for block.json. I think block.json should be reserved for use in plugins where it defines the settings of individual blocks. Use theme.json for defining global settings, including blocks, if contained in the theme.
This behaviour was reported as a bug and will be fixed in WordPress version 6.0.
Github pull request:
https://github.com/WordPress/wordpress-develop/pull/2494