4.7.3 • Published 8 months ago

@gravityforms/dependency-extraction-webpack-plugin v4.7.3

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
8 months ago

Gravity Forms Dependency Extraction Webpack Plugin

This plugin enhances the WordPress Dependency Extraction Webpack Plugin by adding automatic inclusion of Gravity Forms dependencies alongside WordPress dependencies. Use this if you are developing features or add-ons that extend Gravity Forms and want to use our externals instead of bundling our code yourselves. This is also used by the Gravity Forms plugin itself.

Installation

To install the module, use the following command:

npm install @gravityforms/dependency-extraction-webpack-plugin --save-dev

Usage

Integrate this plugin just like you would with the Dependency Extraction Webpack Plugin. The API remains identical, except for a few custom options we have added listed below, but it now also processes Gravity Forms packages automatically.

const GravityFormsDependencyExtractionWebpackPlugin = require('@gravityforms/dependency-extraction-webpack-plugin');

module.exports = {
  // other webpack config
  plugins: [new GravityFormsDependencyExtractionWebpackPlugin()],
};

Options

You can pass an object to the constructor to modify the plugin's behavior, for instance:

module.exports = {
  plugins: [
    new GravityFormsDependencyExtractionWebpackPlugin({
      bundledPackages: ['@gravityforms/libraries'],
    }),
  ],
};

bundledPackages

  • Type: array
  • Default: []

This option specifies an array of packages to ignore during externals mapping. These packages will be included within your bundle and not mapped to the external.

An important note on our @gravityforms/components package. If you pass @gravityforms/components here, it will exclude all the components, but you can also pass @gravityforms/components/react/admin/modules/Dialog to only exclude the Dialog component. This could be useful if you want to use a version of the package that has that component in a state that is ahead of what core has shipped with. All other components will map to our externals, but this one will be included in the bundle.

rootNamespace

  • Type: string
  • Default: 'gform'

If you are using our components by enqueuing the compiled files yourself instead of using the ones enqueued by Gravity Forms, you need to set this option to the same one you used in that package. Check the components readme for more details.

For more configuration options, refer to the original dependency extraction plugin.

4.7.3

8 months ago

4.7.2

8 months ago

4.7.1

9 months ago

4.7.0

9 months ago

4.6.3

9 months ago

4.6.2

9 months ago

4.6.0

9 months ago

4.5.0-beta.1

10 months ago