build-info-webpack-plugin

1.0.2 • Public • Published

build-info-webpack-plugin

Expose build specific information in global variables for debugging.

NPM Version

Install

$ npm install build-info-webpack-plugin

Usage

webpack.config.js

const BuildInfoPlugin = require('build-info-webpack-plugin');

module.exports = {
    plugins: [BuildInfoPlugin]
};

package.json

This plugin stores the latest build number in package.json so that it can be incremented upon subsequent builds. If the buildNumber property does not exist, package.json will not be modified.

{
  ...
  "buildNumber": 0,
  ...
}

src/js/app.js

console.log(__BUILD_NUMBER__); // 1
console.log(__BUILD_UUID__); // eeabc64a-43d2-4284-8684-2e75a151e3af
console.log(__BUILD_DATE__); // 11/16/2020, 1:21:26 AM
console.log(__BUILD_COMMIT_HASH__); // 87326daf059935dd6f078700261714de413342d3

Readme

Keywords

none

Package Sidebar

Install

npm i build-info-webpack-plugin

Weekly Downloads

9

Version

1.0.2

License

MIT

Unpacked Size

4.27 kB

Total Files

5

Last publish

Collaborators

  • neogeek