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:
parent
4e340ee3ed
commit
34140b197f
|
@ -103,7 +103,7 @@ class MiniCart extends AbstractBlock {
|
||||||
$script = [
|
$script = [
|
||||||
'handle' => 'wc-' . $this->block_name . '-block-frontend',
|
'handle' => 'wc-' . $this->block_name . '-block-frontend',
|
||||||
'path' => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
|
'path' => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ),
|
||||||
'dependencies' => [],
|
'dependencies' => [ 'wc-blocks-registry' ],
|
||||||
];
|
];
|
||||||
return $key ? $script[ $key ] : $script;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue