https://github.com/btmpl/webpack-fingerprint
Generate list of all libraries imported in bundling process and their versions.
https://github.com/btmpl/webpack-fingerprint
json license license-management webpack
Last synced: 4 months ago
JSON representation
Generate list of all libraries imported in bundling process and their versions.
- Host: GitHub
- URL: https://github.com/btmpl/webpack-fingerprint
- Owner: BTMPL
- License: mit
- Created: 2017-09-17T15:53:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-24T15:30:37.000Z (about 7 years ago)
- Last Synced: 2025-06-25T12:53:28.978Z (5 months ago)
- Topics: json, license, license-management, webpack
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Webpack Fingerprint Plugin
====================
This plugin will generate list of node modules (along with their version and licence)
which were imported into the bundle and place it in an JSON file
The most common usage will be for tracking what versions are deployed with current version
of your application and tracking their licenses for legal requirements.
## Installation
The plugin is available via [npm](https://www.npmjs.com/package/webpack-fingerprint):
```
$ npm install --save webpack-fingerprint
```
## Examples
### Basic
```js
var WebpackFingerprint = require("webpack-fingerprint");
module.exports = {
plugins: [
new WebpackFingerprint({
filename: "fingerprint.json" // Default
})
]
}
```
Will produce a file called `fingerprint.json` with following info:
```js
{
"date": "2017-09-17T15:56:50.468Z",
"version": "1.0.0",
"packages": {
"babel-loader": {
"version": "7.1.2",
"license": "MIT"
}
"react": {
"version": "15.6.1",
"license": "BSD-3-Clause"
}
"react-dom": {
"version": "15.6.1",
"license": "BSD-3-Clause"
}
}
}
```
### Custom information
You can provide additional information to also be stored in the resulting file. To do so, pass a `additional` field on the configuration object.
```js
var WebpackFingerprint = require("webpack-fingerprint");
module.exports = {
plugins: [
new WebpackFingerprint({
additional: {
build_number: process.env.CI_BUILD_NUMBER
}
})
]
}
```
### Custom package details
You can also provide a transformer that will allow you to change the default information stored for each package. To do so, provide a `transformer` function, which will be called with each module `package.json` file and its return value will be used. If `null` is returned by all transformers, the `package` field will be omitted.
```js
var WebpackFingerprint = require("webpack-fingerprint");
module.exports = {
plugins: [
new WebpackFingerprint({
transformer: (package) => ({
version: package.version,
author: package.author
})
})
]
}
```