build-info-webpack-plugin
v1.0.2
Published
Expose build specific information in global variables for debugging.
Downloads
5
Readme
build-info-webpack-plugin
Expose build specific information in global variables for debugging.
Install
$ npm install build-info-webpack-pluginUsage
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