Socket
Book a DemoInstallSign in
Socket

@woocommerce/dependency-extraction-webpack-plugin

Package Overview
Dependencies
Maintainers
10
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@woocommerce/dependency-extraction-webpack-plugin

WooCommerce Dependency Extraction Webpack Plugin

latest
Source
npmnpm
Version
4.0.0
Version published
Weekly downloads
1.8K
-14.15%
Maintainers
10
Weekly downloads
 
Created
Source

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() ],
};

Note: If you plan to extend the webpack configuration from @wordpress/scripts with WooCommerceDependencyExtractionWebpackPlugin, be sure to remove the default instance of the plugin:

const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const webpackConfig = {
	...defaultConfig,
	plugins: [
		...defaultConfig.plugins.filter(
			( plugin ) =>
				plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
		),
		new WooCommerceDependencyExtractionWebpackPlugin(),
	],
};

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

RequestGlobalScript handleNotes
@woocommerce/datawc['data']wc-store-data
@woocommerce/csv-exportwc['csvExport']wc-csv
@woocommerce/blocks-registrywc['wcBlocksRegistry']wc-blocks-registry
@woocommerce/block-datawc['wcBlocksData']wc-blocks-data-storeThis dependency does not have an associated npm package
@woocommerce/settingswc['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.

Keywords

wordpress

FAQs

Package last updated on 24 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.