I\'d like to inject a build number and version information to my project as it\'s built with webpack. For example, so that my code can do something like:
var bui
I made a webpack loader that injects build information into an automatically generated file. You can find it on npm.
Once you install it, you can use it like this:
import buildinfo from "!webpack-plugin-buildinfo?gitHashShort&time!";
console.log(
`MyCoolProject v${buildinfo.gitHashShort} compiled at ${new Date(
buildinfo.time
).toISOString()}`
);
For more information, visit the github repo.