Skip to content

Commit

Permalink
add: @woocommerce/block-data in Webpack deps extraction (woocommerc…
Browse files Browse the repository at this point in the history
  • Loading branch information
frosso authored Mar 2, 2022
1 parent 72e885e commit 23c19e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: Add

#7911 - Added @woocommerce/block-data to Webpack Dependency Extraction plugin
15 changes: 8 additions & 7 deletions packages/dependency-extraction-webpack-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ module.exports = {

Additional module requests on top of Wordpress [Dependency Extraction Webpack Plugin](https://github.com/WordPress/gutenberg/tree/master/packages/dependency-extraction-webpack-plugin) are:

| Request | Global | Script handle |
| ------------------------------ | ------------------------ | -------------------- |
| `@woocommerce/data` | `wc['data']` | `wc-store-data` |
| `@woocommerce/csv-export` | `wc['csvExport']` | `wc-csv` |
| `@woocommerce/blocks-registry` | `wc['wcBlocksRegistry']` | `wc-blocks-registry` |
| `@woocommerce/settings` | `wc['wcSettings']` | `wc-settings` |
| `@woocommerce/*` | `wc['*']` | `wc-*` |
| Request | Global | Script handle | Notes |
| ------------------------------ | ------------------------ | ---------------------- | --------------------------------------------------------|
| `@woocommerce/data` | `wc['data']` | `wc-store-data` | |
| `@woocommerce/csv-export` | `wc['csvExport']` | `wc-csv` | |
| `@woocommerce/blocks-registry` | `wc['wcBlocksRegistry']` | `wc-blocks-registry` | |
| `@woocommerce/block-data` | `wc['wcBlocksData']` | `wc-blocks-data-store` | This dependency does not have an associated npm package |
| `@woocommerce/settings` | `wc['wcSettings']` | `wc-settings` | |
| `@woocommerce/*` | `wc['*']` | `wc-*` | |

#### Options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = [
'@woocommerce/tracks',
// wc-blocks packages
'@woocommerce/blocks-checkout',
'@woocommerce/block-data',
'@woocommerce/blocks-registry',
'@woocommerce/settings',
];
2 changes: 2 additions & 0 deletions packages/dependency-extraction-webpack-plugin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const wooRequestToExternal = ( request, excludedExternals ) => {
if ( packages.includes( request ) ) {
const handle = request.substring( WOOCOMMERCE_NAMESPACE.length );
const irregularExternalMap = {
'block-data': [ 'wc', 'wcBlocksData' ],
'blocks-registry': [ 'wc', 'wcBlocksRegistry' ],
settings: [ 'wc', 'wcSettings' ],
};
Expand All @@ -42,6 +43,7 @@ const wooRequestToHandle = ( request ) => {
const handle = request.substring( WOOCOMMERCE_NAMESPACE.length );
const irregularHandleMap = {
data: 'wc-store-data',
'block-data': 'wc-blocks-data-store',
'csv-export': 'wc-csv',
};

Expand Down

0 comments on commit 23c19e9

Please sign in to comment.