Mini Cart: load wc-blocks-registry package at the load of the page instead of lazy load it (https://github.com/woocommerce/woocommerce-blocks/pull/7813)

This commit is contained in:
Luigi Teschio 2022-12-01 18:31:24 +01:00 committed by GitHub
parent 4e340ee3ed
commit 34140b197f
1 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ class MiniCart extends AbstractBlock {
$script = [
'handle' => 'wc-' . $this->block_name . '-block-frontend',
'path' => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
'dependencies' => [],
'dependencies' => [ 'wc-blocks-registry' ],
];
return $key ? $script[ $key ] : $script;
}
@ -273,7 +273,7 @@ class MiniCart extends AbstractBlock {
}
}
}
if ( ! $script->src ) {
if ( ! $script->src || 'wc-blocks-registry' === $script->handle ) {
return;
}