JSPM

  • Created
  • Published
  • Downloads 721
  • Score
    100M100P100Q97471F
  • License GPL-2.0-or-later

Dependency extraction webpack plugin for use in Gravity Forms development. Extends the WordPress plugin.

Package Exports

  • @gravityforms/dependency-extraction-webpack-plugin
  • @gravityforms/dependency-extraction-webpack-plugin/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gravityforms/dependency-extraction-webpack-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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 addons that extend Gravity Forms and want to use our externals instead of bundling our code yourselves. 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 potential Gravity Forms excluded packages. These packages will be included within the bundle (as shown in the example above) and not mapped to the external.

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