6.23.0 • Published 6 months ago
@popup-maker/dependency-extraction-webpack-plugin v6.23.0
Dependency Extraction Webpack Plugin
Extends Wordpress Dependency Extraction Webpack Plugin to automatically include Popup Maker dependencies in addition to WordPress dependencies.
Installation
Install the module
pnpm install @popup-maker/dependency-extraction-webpack-plugin --save-devUsage
Use this as you would Dependency Extraction Webpack Plugin. The API is exactly the same, except that Popup Maker packages are also handled automatically.
// webpack.config.js
const PopupMakerDependencyExtractionWebpackPlugin = require( '@popup-maker/dependency-extraction-webpack-plugin' );
module.exports = {
// …snip
plugins: [ new PopupMakerDependencyExtractionWebpackPlugin() ],
};Additional module requests on top of Wordpress Dependency Extraction Webpack Plugin are:
| Request | Global | Script handle | Notes |
|---|---|---|---|
@popup-maker/* | popupMaker['*'] | popup-maker-* |
Options
An object can be passed to the constructor to customize the behavior, for example:
module.exports = {
plugins: [
new PopupMakerDependencyExtractionWebpackPlugin( {
bundledPackages: [ '@popup-maker/components' ],
} ),
],
};bundledPackages
- Type: array
- Default: []
A list of potential Popup Maker excluded packages, this will include the excluded package within the bundle (example above).
For more supported options see the original dependency extraction plugin.