Registry / devops / license-info-webpack-plugin

license-info-webpack-plugin

JSON →
library3.0.0jsnpmunverified

A webpack plugin that collects LICENSE information from all dependencies and outputs it as a banner comment or separate HTML file. Current stable version is 3.0.0. It is inspired by licensify and supports webpack 3 and 4. Key differentiators include configurable glob patterns for license files, two output types (banner and HTML), and optional inclusion of the license file itself. The plugin handles preservation of license comments during minification when used with uglifyjs-webpack-plugin.

npm install license-info-webpack-plugin
INSTALL
IMPORT
SIG · LICENSE-INFO-WEBPA
L
license-info-webpack-plugin
devopsjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LicenseInfoWebpackPlugin
import LicenseInfoWebpackPlugin from 'license-info-webpack-plugin'
const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin')
The package exports a default export. Using require with destructuring may fail; use require('license-info-webpack-plugin').default instead.
default
const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default
const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin')
In CommonJS, the plugin is not the default export of the module; you must access .default to get the constructor.
LicenseInfoWebpackPlugin (type)
import type { LicenseInfoWebpackPluginOptions } from 'license-info-webpack-plugin'
The package does not export TypeScript types; type definitions must be authored manually or are not provided.

Demonstrates basic usage of the plugin in a webpack configuration, showing all available options.

const path = require('path'); const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default; module.exports = { mode: 'production', entry: './src/index.js', output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js' }, plugins: [ new LicenseInfoWebpackPlugin({ glob: '{LICENSE,license,License}*', outputType: 'banner', includeLicenseFile: true }) ] };
Debug
Known issues
gotchaCommonJS require without .default returns an object, not the constructor.
fix
Use require('license-info-webpack-plugin').default instead of require('license-info-webpack-plugin').
affects: >=1.0.0
gotchaIn webpack 4 with uglifyjs-webpack-plugin older than 1.2.4, license comments may be stripped without explicit uglifyOptions.
fix
Set uglifyOptions in optimization to preserve comments with @license, @preserve, etc.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: LicenseInfoWebpackPlugin is not a constructor
Using require without .default when the package uses ES module default export.
fix
const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default;
Error: Plugin could not be instantiated - options.glob is not a string
The glob option expects a string pattern; passing an array or other type.
fix
Set glob to a string like '{LICENSE,license,License}*'.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
license-info-webpack-plugin — npm install license-info-webpack-plugin · libregistry