A webpack plugin that extracts open source license information from npm packages in your webpack output. Current stable version is 4.5.1, released with regular updates. It supports webpack 2 through 5 and helps generate a bill of materials in JSON, HTML, CSV, or custom formats. Key differentiators include built-in license policy enforcement (fail on unacceptable licenses), exclusion of internal packages, and full test coverage. Since v4.4.1, the package ships both ESM and CJS builds with TypeScript types, and requires Node >=16.
npm install webpack-license-pluginVerified import paths — ran on the pinned version, not inferred.
Basic usage with options: output JSON, reject GPL-family licenses, exclude internal packages.
Upgrade Node to version 16 or later.
If you encounter stale license output, clear the webpack cache or configure the plugin to run on every build.
Migrate to the new options schema (see README).
Set the `outputFormatter` option to a function that returns the desired format string.
Run `npm install -D webpack-license-plugin` or `yarn add -D webpack-license-plugin` and ensure your import uses the correct path.
Use `import LicensePlugin from 'webpack-license-plugin'` (default import) instead of `import { LicensePlugin } from 'webpack-license-plugin'`.Install webpack: `npm install webpack` or `yarn add webpack`.