Created
March 28, 2022 00:59
-
-
Save whudson/b4323a27306970b17aec51398a35dd64 to your computer and use it in GitHub Desktop.
Webpack plugin to output some info about the build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OutputBuildInfoPlugin { // webpack plugin | |
apply(compiler) { | |
compiler.hooks.done.tap('OutputBuildInfo', (stats) => { | |
let dateString = new Intl.DateTimeFormat('en-US', { | |
hour: "numeric", | |
minute: "numeric", | |
second: "numeric", | |
year: "numeric", | |
month: "2-digit", | |
day: "2-digit", | |
}).format(new Date()).replace(',', ''); | |
console.log(`Hash: ${stats.hash}`); | |
console.log(`Built at: ${dateString}`) | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment