generate-license-file-webpack-plugin

Webpack plugin to generate a text file asset containing all of the licenses for your production third-party dependencies.

Usage no npm install needed!

<script type="module">
  import generateLicenseFileWebpackPlugin from 'https://cdn.skypack.dev/generate-license-file-webpack-plugin';
</script>

README

generate-license-file-webpack-plugin

Webpack plugin to generate a text file asset containing all of the licenses for your production third-party dependencies.

npm

Based on the npm package generate-licence-file.
Currently supports Webpack v5.

Usage

To use the default configuration, construct the plugin in your webpack plugins array:

// webpack.config.js
const { LicenseFilePlugin } = require("generate-license-file-webpack-plugin");

module.exports = {
  plugins: [new LicenseFilePlugin()]
};

The plugin can be configured using the following options. Below shows the default values:

// webpack.config.js
const { LicenseFilePlugin } = require("generate-license-file-webpack-plugin");

module.exports = {
  plugins: [
    new LicenseFilePlugin({
      outputFileName: "third-party-licenses.txt",
      outputFolder: "./", // Relative to your build output directory
      pathToPackageJson: "./package.json",
      isDev: false, // When true, uses placeholder content to reduce compilation time
      lineEnding: undefined // Can be 'windows' or 'posix'. If omitted, the system default will be used
    })
  ]
};

Building the plugin yourself

npm install
npm run build

License

generate-license-file-webpack-plugin is licensed under the ISC License.