An open API service indexing awesome lists of open source software.

https://github.com/mkwtys/selenic-webpack-plugin

webpack plugin to add license header to bundle
https://github.com/mkwtys/selenic-webpack-plugin

license plugin webpack

Last synced: 9 months ago
JSON representation

webpack plugin to add license header to bundle

Awesome Lists containing this project

README

          

# @selenic/webpack-plugin

[![Actions Status](https://github.com/mkwtys/selenic/workflows/Node%20CI/badge.svg)](https://github.com/mkwtys/selenic-webpack-plugin/actions?query=workflow%3A%22Node+CI%22)
[![codecov](https://codecov.io/gh/mkwtys/selenic-webpack-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/mkwtys/selenic-webpack-plugin)
[![npm version](https://badge.fury.io/js/%40selenic%2Fwebpack-plugin.svg)](https://badge.fury.io/js/%40selenic%2Fwebpack-plugin)

`@selenic/webpack-plugin` is add license header to your bundle as follows.

```js
/**
* @license
*
* @selenic/webpack-plugin:
* version: 0.9.0
* license: MIT
* author: mkwtys
*
* @selenic/core:
* version: 0.11.0
* license: MIT
* author: mkwtys
* homepage: https://github.com/mkwtys/selenic
*
* base64-js:
* version: 1.3.1
* license: MIT
* author: T. Jameson Little
* homepage: https://github.com/beatgammit/base64-js
*
* buffer:
* version: 4.9.2
* license: MIT
* author: Feross Aboukhadijeh
* contributors: Romain Beauxis , James Halliday
* homepage: https://github.com/feross/buffer
*
* find-up:
* version: 3.0.0
* license: MIT
* author: Sindre Sorhus
* homepage: https://github.com/sindresorhus/find-up
*
* ieee754:
* version: 1.1.13
* license: BSD-3-Clause
* author: Feross Aboukhadijeh
* contributors: Romain Beauxis
* homepage: https://github.com/feross/ieee754
*
* isarray:
* version: 1.0.0
* license: MIT
* author: Julian Gruber
* homepage: https://github.com/juliangruber/isarray
*
* locate-path:
* version: 3.0.0
* license: MIT
* author: Sindre Sorhus
* homepage: https://github.com/sindresorhus/locate-path
*
* p-limit:
* version: 2.2.0
* license: MIT
* author: Sindre Sorhus
* homepage: https://github.com/sindresorhus/p-limit
*
* p-locate:
* version: 3.0.0
* license: MIT
* author: Sindre Sorhus
* homepage: https://github.com/sindresorhus/p-locate
*
* p-try:
* version: 2.2.0
* license: MIT
* author: Sindre Sorhus
* homepage: https://github.com/sindresorhus/p-try
*
* path-browserify:
* version: 0.0.1
* license: MIT
* author: James Halliday
* homepage: https://github.com/substack/path-browserify
*
* path-exists:
* version: 3.0.0
* license: MIT
* author: Sindre Sorhus
* homepage: https://github.com/sindresorhus/path-exists
*
* pkg-up:
* version: 3.1.0
* license: MIT
* author: Sindre Sorhus
* homepage: https://github.com/sindresorhus/pkg-up
*
* process:
* version: 0.11.10
* license: MIT
* author: Roman Shtylman
* homepage: https://github.com/shtylman/node-process
*
* punycode:
* version: 1.4.1
* license: MIT
* author: Mathias Bynens
* contributors: Mathias Bynens, John-David Dalton
* homepage: https://mths.be/punycode
*
* querystring-es3:
* version: 0.2.1
* license: MIT
* author: Irakli Gozalishvili
* homepage: https://github.com/mike-spainhower/querystring
*
* semver:
* version: 7.3.2
* license: ISC
* homepage: https://github.com/npm/node-semver
*
* source-list-map:
* version: 2.0.1
* license: MIT
* author: Tobias Koppers @sokra
* homepage: https://github.com/webpack/source-list-map
*
* source-map:
* version: 0.6.1
* license: BSD-3-Clause
* author: Nick Fitzgerald
* contributors: Tobias Koppers , Duncan Beevers , Stephen Crane , Ryan Seddon , Miles Elam , Mihai Bazon , Michael Ficarra , Todd Wolfson , Alexander Solovyov , Felix Gnass , Conrad Irwin , usrbincc , David Glasser , Chase Douglas , Evan Wallace , Heather Arthur , Hugh Kennedy , David Glasser , Simon Lydell , Jmeas Smith , Michael Z Goddard , azu , John Gozde , Adam Kirkton , Chris Montgomery , J. Ryan Stinnett , Jack Herrington , Chris Truter , Daniel Espeset , Jamie Wong , Eddy Bruël , Hawken Rives , Gilad Peleg , djchie , Gary Ye , Nicolas Lalevée
* homepage: https://github.com/mozilla/source-map
*
* url:
* version: 0.11.0
* license: MIT
* homepage: https://github.com/defunctzombie/node-url
*
* webpack:
* version: 4.43.0
* license: MIT
* author: Tobias Koppers @sokra
* homepage: https://github.com/webpack/webpack
*
* webpack-sources:
* version: 1.4.3
* license: MIT
* author: Tobias Koppers @sokra
* homepage: https://github.com/webpack/webpack-sources
*
*/
...
```

## Install

```sh
npm install --save-dev @selenic/webpack-plugin
```

## Usage

To use `@selenic/webpack-plugin`, you need to set the `optimize.minimize` option to `false`. If you want to minify, use the minify plugin.

webpack.config.js:

```js
import { SelenicWebpackPlugin } from '@selenic/webpack-plugin'
import TerserWebpackPlugin from 'terser-webpack-plugin'

...
plugins: [
new TerserWebpackPlugin(options),
new SelenicWebpackPlugin()
],
optimization: {
minimize: false
}
...
```

## License

MIT © [mkwtys](https://github.com/mkwtys)