{"id":20187,"library":"license-info-webpack-plugin","title":"License Info Webpack Plugin","description":"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.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/yami-beta/license-info-webpack-plugin","tags":["javascript","webpack","license","plugin"],"install":[{"cmd":"npm install license-info-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add license-info-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add license-info-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a default export. Using require with destructuring may fail; use require('license-info-webpack-plugin').default instead.","wrong":"const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin')","symbol":"LicenseInfoWebpackPlugin","correct":"import LicenseInfoWebpackPlugin from 'license-info-webpack-plugin'"},{"note":"In CommonJS, the plugin is not the default export of the module; you must access .default to get the constructor.","wrong":"const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin')","symbol":"default","correct":"const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default"},{"note":"The package does not export TypeScript types; type definitions must be authored manually or are not provided.","wrong":"","symbol":"LicenseInfoWebpackPlugin (type)","correct":"import type { LicenseInfoWebpackPluginOptions } from 'license-info-webpack-plugin'"}],"quickstart":{"code":"const path = require('path');\nconst LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default;\n\nmodule.exports = {\n  mode: 'production',\n  entry: './src/index.js',\n  output: {\n    path: path.join(__dirname, 'dist'),\n    filename: 'bundle.js'\n  },\n  plugins: [\n    new LicenseInfoWebpackPlugin({\n      glob: '{LICENSE,license,License}*',\n      outputType: 'banner',\n      includeLicenseFile: true\n    })\n  ]\n};","lang":"javascript","description":"Demonstrates basic usage of the plugin in a webpack configuration, showing all available options."},"warnings":[{"fix":"Use require('license-info-webpack-plugin').default instead of require('license-info-webpack-plugin').","message":"CommonJS require without .default returns an object, not the constructor.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set uglifyOptions in optimization to preserve comments with @license, @preserve, etc.","message":"In webpack 4 with uglifyjs-webpack-plugin older than 1.2.4, license comments may be stripped without explicit uglifyOptions.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default;","cause":"Using require without .default when the package uses ES module default export.","error":"TypeError: LicenseInfoWebpackPlugin is not a constructor"},{"fix":"Set glob to a string like '{LICENSE,license,License}*'.","cause":"The glob option expects a string pattern; passing an array or other type.","error":"Error: Plugin could not be instantiated - options.glob is not a string"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}