
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
license-webpack-plugin
Advanced tools
The license-webpack-plugin is a plugin for Webpack that helps you to manage and automate the process of handling license information for the packages included in your bundle. It can generate a license file, include license texts in your bundle, and filter packages based on their licenses.
Generate a license file
This feature allows you to generate a single file that contains all the license information for the packages included in your webpack bundle. The 'outputFilename' option specifies the name of the file to be created.
new LicenseWebpackPlugin({
outputFilename: 'licenses.txt'
})
Include license texts in the bundle
With this feature, you can include the license texts directly in your webpack bundle. Setting 'perChunkOutput' to false will include all licenses in the main bundle file instead of separate chunk files.
new LicenseWebpackPlugin({
perChunkOutput: false
})
Filter packages by license type
This feature allows you to filter which packages to include based on their license type. In this example, only packages with the 'MIT' license will be included.
new LicenseWebpackPlugin({
licenseInclusionTest: (licenseType) => licenseType === 'MIT'
})
Similar to license-webpack-plugin, webpack-license-plugin also helps in managing licenses for third-party dependencies. It can generate a third-party notices file including all licenses. It differs in the way it handles the output and configuration options.
This plugin is another alternative that scans your node_modules directory to check for licenses and outputs a summary of the license information. It is less focused on bundling the licenses with the webpack output and more on reporting and compliance.
Manage third-party license compliance in your webpack build.
npm install license-webpack-plugin --save-dev
To use the plugin, simply add it to the plugins section in the webpack config.
Example:
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
module.exports = {
plugins: [
new LicenseWebpackPlugin()
]
};
The default behavior will add a license notice file to each chunk of the webpack build. In addition, it will add a banner indicating the path to the license notice file in any Javascript assets. Third party libraries imported via external tools like SASS @import
may not appear in the output (since webpack does not process @import
). If this issue happens, please specify additional modules that the plugin should scan.
To configure the plugin, check the documentation.
yarn
yarn build
Migration guides for breaking changes are documented here.
The changelog can be found here.
[4.0.2] - 2022-02-10
excludedPackageTest
option not being respectedFAQs
Outputs licenses from 3rd party libraries to a file
The npm package license-webpack-plugin receives a total of 3,176,247 weekly downloads. As such, license-webpack-plugin popularity was classified as popular.
We found that license-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.