Fix loading opt-in block metadata
Build version of plugin doesn't contain assets/js folder. We need to copy block.json file with the metadata to assets/dist directory and load it from there. [MAILPOET-3920]
This commit is contained in:
committed by
Veljko V
parent
e9202d840a
commit
ae33ab8d82
@@ -59,7 +59,7 @@ class WooCommerceBlocksIntegration {
|
|||||||
'__experimental_woocommerce_blocks_add_data_attributes_to_block',
|
'__experimental_woocommerce_blocks_add_data_attributes_to_block',
|
||||||
[$this, 'addDataAttributesToBlock']
|
[$this, 'addDataAttributesToBlock']
|
||||||
);
|
);
|
||||||
$this->wp->registerBlockType(Env::$assetsPath . '/js/src/marketing_optin_block');
|
$this->wp->registerBlockType(Env::$assetsPath . '/dist/js/marketing_optin_block');
|
||||||
$this->extendRestApi();
|
$this->extendRestApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -488,6 +488,14 @@ const marketingOptinBlock = Object.assign({}, wpScriptConfig, {
|
|||||||
requestToExternal,
|
requestToExternal,
|
||||||
requestToHandle,
|
requestToHandle,
|
||||||
}),
|
}),
|
||||||
|
new WebpackCopyPlugin({
|
||||||
|
patterns: [
|
||||||
|
{
|
||||||
|
from: 'assets/js/src/marketing_optin_block/block.json',
|
||||||
|
to: 'block.json',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user