This commit is contained in:
Kelly Dwan 2018-11-27 12:13:16 -05:00 committed by GitHub
parent 133e5374af
commit eb21a5ec9f
2 changed files with 17 additions and 3 deletions

View File

@ -13,9 +13,12 @@ const externals = {
'@wordpress/blocks': { this: [ 'wp', 'blocks' ] },
'@wordpress/components': { this: [ 'wp', 'components' ] },
'@wordpress/compose': { this: [ 'wp', 'compose' ] },
'@wordpress/editor': { this: [ 'wp', 'editor' ] },
'@wordpress/data': { this: [ 'wp', 'data' ] },
'@wordpress/element': { this: [ 'wp', 'element' ] },
'@wordpress/editor': { this: [ 'wp', 'editor' ] },
'@wordpress/i18n': { this: [ 'wp', 'i18n' ] },
'@wordpress/url': { this: [ 'wp', 'url' ] },
lodash: 'lodash',
};
/**
@ -58,7 +61,7 @@ const GutenbergBlocksConfig = {
'@import "_breakpoints"; ' +
'@import "_mixins"; ',
},
}
},
],
},
],

View File

@ -76,7 +76,18 @@ function wgpb_extra_gutenberg_scripts() {
wp_register_script(
'woocommerce-products-category-block',
plugins_url( 'build/product-category-block.js', __FILE__ ),
array( 'wp-element', 'wp-blocks', 'wp-i18n' ),
array(
'wp-api-fetch',
'wp-blocks',
'wp-components',
'wp-compose',
'wp-data',
'wp-element',
'wp-editor',
'wp-i18n',
'wp-url',
'lodash',
),
defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? filemtime( plugin_dir_path( __FILE__ ) . '/build/product-category-block.js' ) : WGPB_VERSION,
true
);