woocommerce/packages/js/dependency-extraction-webpa...
Matt Sherman af24637439
Create @woocommerce/admin-layout package (#37094)
* Initial admin-layout package skeleton

* Changelog files

* Use createOrderedChildren and sortFillsByOrder from @woocommerce/components for WooFooterItem

* Move WooFooterItem to @woocommerce/admin-layout

* Use WooFooterItem from @woocommerce/admin-layout

* Suppress errant TS lint errors

* Exports for @woocommerce/admin-layout

* Fill updates and eslint suppression

* Changelogs

* Remove suppression of tslint errors

* Fix react and @types/react versions

* Load @woocommerce/admin-layout script and styles

* Move WooHeaderItem, WooHeaderNavigationItem, and WooHeaderPageTitle to @woocommerce/admin-layout

* Regenerate lock file post-rebase

* Remove duplicate import post-rebase

* Add wc-admin-layout to app style dependency

* Fix jest mock of @woocommerce/admin-layout

* Fix spacing.

* Export slot names

* Fix typo in .npmrc

* Update lock file

* Try updating lock file

* Update lock file

* Update lock file

* Update to latest lock file from trunk

* Update lock file

* Sync dependencies of @woocommerce/admin-layout

* Manually sync @wordpress dependencies
2023-03-10 09:58:02 -05:00
..
assets Create @woocommerce/admin-layout package (#37094) 2023-03-10 09:58:02 -05:00
changelog Create @woocommerce/admin-layout package (#37094) 2023-03-10 09:58:02 -05:00
src Moved WCA Packages 2022-03-18 14:25:26 -07:00
.eslintrc.js Add .eslintrc config to each packages 2022-03-29 16:08:07 +08:00
.gitignore Update JS packages changelogs (#33412) 2022-06-16 10:06:31 +12:00
.npmrc Moved WCA Packages 2022-03-18 14:25:26 -07:00
CHANGELOG.md Prepare Packages for Release (#33776) 2022-07-08 14:04:49 +12:00
PREVIOUS_CHANGELOG.md Update JS packages changelogs (#33412) 2022-06-16 10:06:31 +12:00
README.md Moved WCA Packages 2022-03-18 14:25:26 -07:00
composer.json Update changelogger to 3.3.0 to support PR number capturing with merge (#36266) 2023-01-05 14:42:51 +05:30
composer.lock Update changelogger to 3.3.0 to support PR number capturing with merge (#36266) 2023-01-05 14:42:51 +05:30
package.json Consolidate eslint versions (#36700) 2023-02-02 23:25:04 +13:00

README.md

Dependency Extraction Webpack Plugin

Extends Wordpress Dependency Extraction Webpack Plugin to automatically include WooCommerce dependencies in addition to WordPress dependencies.

Installation

Install the module

pnpm install @woocommerce/dependency-extraction-webpack-plugin --save-dev

Usage

Use this as you would Dependency Extraction Webpack Plugin. The API is exactly the same, except that WooCommerce packages are also handled automatically.

// webpack.config.js
const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );

module.exports = {
	// …snip
	plugins: [ new WooCommerceDependencyExtractionWebpackPlugin() ],
};

Additional module requests on top of Wordpress Dependency Extraction Webpack Plugin are:

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

An object can be passed to the constructor to customize the behavior, for example:

module.exports = {
	plugins: [
		new WooCommerceDependencyExtractionWebpackPlugin( {
			bundledPackages: [ '@woocommerce/components' ],
		} ),
	],
};
bundledPackages
  • Type: array
  • Default: []

A list of potential WooCommerce excluded packages, this will include the excluded package within the bundle (example above).

For more supported options see the original dependency extraction plugin.