Socket
Socket
Sign inDemoInstall

license-webpack-plugin

Package Overview
Dependencies
1
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    license-webpack-plugin

Outputs licenses from 3rd party libraries to a file


Version published
Weekly downloads
3.2M
increased by5.18%
Maintainers
1
Install size
198 kB
Created
Weekly downloads
 

Package description

What is license-webpack-plugin?

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.

What are license-webpack-plugin's main functionalities?

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'
})

Other packages similar to license-webpack-plugin

Readme

Source

License Webpack Plugin

Build Status

Manage third-party license compliance in your webpack build.

Installation

npm install license-webpack-plugin --save-dev

Usage

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.

Build Instructions

yarn
yarn build

Migration Guides

Migration guides for breaking changes are documented here.

Changelog

The changelog can be found here.

License

ISC

Keywords

FAQs

Last updated on 10 Feb 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc