https://github.com/alexkrolick/webpack-fingerprint-json
Writes a JSON file with build metadata
https://github.com/alexkrolick/webpack-fingerprint-json
webpack
Last synced: about 2 months ago
JSON representation
Writes a JSON file with build metadata
- Host: GitHub
- URL: https://github.com/alexkrolick/webpack-fingerprint-json
- Owner: alexkrolick
- License: mit
- Created: 2017-12-28T03:25:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-28T04:07:35.000Z (over 8 years ago)
- Last Synced: 2026-04-28T07:07:58.727Z (2 months ago)
- Topics: webpack
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Webpack Fingerprint Plugin
====================
Writes a JSON file with build metadata
Based on [Webpack Fingerprint](https://www.npmjs.com/package/webpack-fingerprint) but without traversing package dependencies
```
$ npm install --save webpack-fingerprint-json
```
## Examples
### Basic
```js
const WebpackFingerprint = require("webpack-fingerprint-json");
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",
}
```
### Custom information
You can provide additional information to also be stored in the resulting file. To do so, add fields to the `json` field of the configuration object.
```js
const WebpackFingerprint = require("webpack-fingerprint-json");
module.exports = {
plugins: [
new WebpackFingerprint({
filename: path.resolve(__dirname, '../another/folder', 'build.json'), // Custom filepath
json: {
build_number: process.env.CI_BUILD_NUMBER, // Custom JSON values
},
})
]
}
```