Replies: 1 comment 9 replies
-
This may be a problem because I am using this technique in a theme, not a plugin. I've filed a ticket: #40744 |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am building a theme and learning about the concept of registering blocks with
register_block_type('block.json')
. However, when I do, the script/style file asset paths are messed up. Any insights/pointers would be most appreciated as I learn this new way.The editor seems to be trying to load a url based on
https://example.com/mysite/wp-content/plugins/
concatenated with the filesystem path to the block index file:
/shared/httpd/htdocs/wp-content/themes/jmc/build/blocks/jake/index.js?ver=192383983
So the end results look like:
https://example.com/mysite/wp-content/plugins/shared/httpd/htdocs/wp-content/themes/jmc/build/blocks/jake/index.js?ver=c10b6a3ac45e2d11a234a6cd2c193a5c
https://example.com/mysite/wp-content/plugins/shared/httpd/htdocs/wp-content/themes/jmc/build/blocks/jake/index.css?ver=5.9.3
Here's my block.json.
block.json
I'm loading all the block.json files in a loop like so:
registration.php
My
src
directory is structured like so:Beta Was this translation helpful? Give feedback.
All reactions