2020-06-17 13:10:46 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { registerBlockComponent } from '@woocommerce/blocks-registry';
|
2020-07-14 11:35:15 +00:00
|
|
|
import { lazy } from '@wordpress/element';
|
|
|
|
import { WC_BLOCKS_BUILD_URL } from '@woocommerce/block-settings';
|
2020-06-17 13:10:46 +00:00
|
|
|
|
2020-07-14 11:35:15 +00:00
|
|
|
// Modify webpack publicPath at runtime based on location of WordPress Plugin.
|
|
|
|
// eslint-disable-next-line no-undef,camelcase
|
|
|
|
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;
|
2020-06-17 13:10:46 +00:00
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-price',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-price" */ './product-elements/price/block'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-image',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-image" */ './product-elements/image/frontend'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-title',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-title" */ './product-elements/title/frontend'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-rating',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-rating" */ './product-elements/rating/block'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-button',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-button" */ './product-elements/button/block'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-summary',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-summary" */ './product-elements/summary/block'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-sale-badge',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-sale-badge" */ './product-elements/sale-badge/block'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-sku',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-sku" */ './product-elements/sku/block'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-stock-indicator',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-stock-indicator" */ './product-elements/stock-indicator/block'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
registerBlockComponent( {
|
|
|
|
blockName: 'woocommerce/product-add-to-cart',
|
2020-07-14 11:35:15 +00:00
|
|
|
component: lazy( () =>
|
|
|
|
import(
|
2022-03-10 10:00:23 +00:00
|
|
|
/* webpackChunkName: "product-add-to-cart" */ './product-elements/add-to-cart/frontend'
|
2020-07-14 11:35:15 +00:00
|
|
|
)
|
|
|
|
),
|
2020-06-17 13:10:46 +00:00
|
|
|
} );
|