WordPress Improvement Stack Alternate is a query and reply web site for WordPress builders and directors. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The most effective solutions are voted up and rise to the highest
Requested
Seen
9 occasions
I constructed a plugin that provides a number of customized blocks to guenberg and constructed a web site utilizing gutenberg.
Right this moment I needed to check it with web page velocity insights and came upon that my web site has now a variety of render-blocking JS recordsdata… All these js recordsdata appears to be from gutenberg. My rating is 40… What did I do flawed and the way can I repair it? I’ve different web sites with my customized blocks and these have 90+ rating.
Right here is the listing of render blocking JS recordsdata:
- /wp-includes/js/dist/vendor/lodash.min.js
- /wp-includes/js/dist/vendor/regenerator-runtime.min.js
- /wp-includes/js/dist/vendor/wp-polyfill.min.js
- /wp-includes/js/dist/vendor/react.min.js
- /wp-includes/js/dist/vendor/react-dom.min.js
- /wp-includes/js/dist/dom-ready.min.js
- /wp-includes/js/dist/hooks.min.js
- /wp-includes/js/dist/i18n.min.js
- /wp-includes/js/dist/a11y.min.js
- /wp-includes/js/dist/url.min.js
- /wp-includes/js/dist/api-fetch.min.js
- /wp-includes/js/dist/blob.min.js
- /wp-includes/js/dist/autop.min.js
- /wp-includes/js/dist/block-serialization-default-parser.min.js
- /wp-includes/js/dist/deprecated.min.js
- /wp-includes/js/dist/dom.min.js
- /wp-includes/js/dist/escape-html.min.js
- /wp-includes/js/dist/aspect.min.js
- /wp-includes/js/dist/is-shallow-equal.min.js
- /wp-includes/js/dist/keycodes.min.js
- /wp-includes/js/dist/priority-queue.min.js
- /wp-includes/js/dist/compose.min.js
- /wp-includes/js/dist/redux-routine.min.js
- /wp-includes/js/dist/knowledge.min.js
- /wp-includes/js/dist/html-entities.min.js
- /wp-includes/js/dist/shortcode.min.js
- /wp-includes/js/dist/blocks.min.js
- /wp-includes/js/dist/vendor/second.min.js
- /wp-includes/js/dist/date.min.js
- /wp-includes/js/dist/primitives.min.js
- /wp-includes/js/dist/rich-text.min.js
- /wp-includes/js/dist/warning.min.js
- /wp-includes/js/dist/parts.min.js
- /wp-includes/js/dist/keyboard-shortcuts.min.js
- /wp-includes/js/dist/notices.min.js
- /wp-includes/js/dist/token-list.min.js
- /wp-includes/js/dist/wordcount.min.js
- /wp-includes/js/dist/block-editor.min.js
- /wp-content/plugins/my_plugin/construct/blocks/card-block.js
- /wp-content/plugins/my_plugin/construct/blocks/card-row-block.js
- /wp-content/plugins/my_plugin/construct/blocks/special-header-row-block.js
2
Okay so…
The issue was induced as a result of I loaded these scripts on the entrance finish in my plugin however these are wanted solely by editor.
To resolve this all I needed to do was change the content material of my block.json recordsdata – substitute the “script” with “editorScript” so these js recordsdata are loaded just for editor 🙂
default