-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
- Part of Block API #41236.
What problem does this address?
I see on the Metadata in block.json page that its possible to add front end, editor and shared styles/scripts in block.json
. I also see you can add multiple scripts for each one of these, even with a mix of file names and previously registered script handles. For example, "style": [ "file:./style.css", "example-shared-style" ]
. This is great as it eliminates the need to enqueue these with wp_enqueue_script
and wp_enqueue_style
in PHP.
However, its not clear to me if you can add an array of dependencies, version, etc. for each script, or if you still have to use wp_enqueue_script
/wp_enqueue_style
when that is needed. If not, it would be even better to add this option, as each script often have their own dependencies, version, etc. It would also be nice to see an example of how to do that.
What is your proposed solution?
Add the option to add multiple styles/scripts with dependencies, version, etc. in block.json (if not already possible) and provide examples of how to do so on the Metadata in block.json page (or elsewhere).