# license-info-webpack-plugin

> Making a list of package's LICENSE information for webpack

Latest version **3.0.0** (published 2020-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install license-info-webpack-plugin
pnpm add license-info-webpack-plugin
yarn add license-info-webpack-plugin
bun add license-info-webpack-plugin
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2020-08-10 |
| First published | 2017-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Takahiro Abe |
| Maintainers | yami-beta |
| Keywords | webpack, license, plugin |

## Links

- npm: https://www.npmjs.com/package/license-info-webpack-plugin
- Repository: https://github.com/yami-beta/license-info-webpack-plugin
- npm.io page: https://npm.io/package/license-info-webpack-plugin

## Dependencies (2)

- [glob](https://npm.io/package/glob.md) ^7.1.6
- [webpack-sources](https://npm.io/package/webpack-sources.md) ^1.4.3

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2020-08-10
- 3.0.0-beta.1 (beta) — 2020-08-10
- 3.0.0-beta.0 — 2020-08-10
- 2.1.1 — 2019-11-23
- 2.1.0 — 2019-11-23
- 2.0.0 — 2019-01-27
- 2.0.0-alpha — 2019-01-27
- 1.1.0 — 2018-10-20
- 1.0.2 — 2018-05-27
- 1.0.1 — 2018-05-23
- 1.0.0 — 2018-02-28
- 0.7.2 — 2017-12-18
- 0.7.1 — 2017-12-18
- 0.7.0 — 2017-10-17
- 0.6.1 — 2017-10-17
- … 1 more at https://npm.io/package/license-info-webpack-plugin/versions

## README

# license-info-webpack-plugin

[![npm version](https://badge.fury.io/js/license-info-webpack-plugin.svg)](https://www.npmjs.com/package/license-info-webpack-plugin)
![](https://github.com/yami-beta/license-info-webpack-plugin/workflows/ci/badge.svg)

`license-info-webpack-plugin` is a webpack plugin for making a list of package's LICENSE information, inspired by [licensify](https://github.com/twada/licensify).

```sh
$ npm install --save-dev license-info-webpack-plugin
```

```sh
$ yarn add --dev license-info-webpack-plugin
```

## Usage

### webpack v4

If you use `webpack < 4.2` that has dependency on `uglifyjs-webpack-plugin < 1.2.4`, you need to set `optimization` to set `uglifyOptions`.

```js
const path = require('path');
const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default;
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

module.exports = {
  mode: 'production',
  entry: './src/js/index.js',
  output: {
    path: path.join(__dirname, 'dist/js'),
    filename: '[name].js'
  },
  plugins: [
    new LicenseInfoWebpackPlugin({
      glob: '{LICENSE,license,License}*'
    })
  ]
};
```

### webpack v3

```js
const path = require('path');
const LicenseInfoWebpackPlugin = require('license-info-webpack-plugin').default;
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

module.exports = {
  entry: './src/js/index.js',
  output: {
    path: path.join(__dirname, 'dist/js'),
    filename: '[name].js'
  },
  plugins: [
    new LicenseInfoWebpackPlugin({
      glob: '{LICENSE,license,License}*'
    }),
    new UglifyJsPlugin({
      uglifyOptions: {
        output: {
          comments: /^\**!|@preserve|@license|@cc_on/
        }
      }
    })
  ]
};
```

### Note

If you use `uglifyjs-webpack-plugin@^1.2.4` or `webpack` has dependency on `uglifyjs-webpack-plugin@^1.2.4`, you **don't need to set `uglifyOptions`** for preserve license comments.  
Related: https://github.com/webpack-contrib/uglifyjs-webpack-plugin/pull/250

If you use `uglifyjs-webpack-plugin@~1.1`, you need to set `uglifyOptions` for preserve license comments.  
Related: https://github.com/webpack-contrib/uglifyjs-webpack-plugin/pull/174

`license-info-webpack-plugin` needs `webpack v3.0 or above`

### Options

- `glob`
    - Glob pattern for LICENSE file
    - Default: `'{LICENSE,license,License}*'`
- `outputType`
    - Output type: `'banner'` or `'html'`
        - `'banner'`: Append comment to top of bundled code
        - `'html'`: Generate html (e.g. `license.[name].html`)
    - Default: `'banner'`
- `includeLicenseFile`
    - Include and put LICENSE file
    - Default: `true`

# LICENSE

MIT

---
_Source: https://npm.io/package/license-info-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
