Skip to content

alexkrolick/webpack-fingerprint-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Webpack Fingerprint Plugin

Writes a JSON file with build metadata

Based on Webpack Fingerprint but without traversing package dependencies

$ npm install --save webpack-fingerprint-json

Examples

Basic

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:

{
  "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.

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
      },
    })
  ]
}

About

Writes a JSON file with build metadata

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published