Gutenberg is mostly made in JS, so I'm using create-guten-block to create some custom blocks. If multiple plugins use this to create blocks, is it a problem that these scripts get compiled and loaded for each plugin instance. Like React, being enqueued multiple times, doesn't it slow the page down?


Any WordPress-packaged scripts enqueued properly via wp_enqueue_script won't load multiple times. If two different plugins rely on the same dependencies, thanks to the enqueue logic, those dependencies will only be loaded once.

create-guten-block only contains javascript relevant to the custom block itself, and sets wp-blocks, wp-i18n, and wp-element (the abstraction layer WP uses on top of React) as its dependencies. See /src/init.php of the generated block code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.