Skip to content

Instantly share code, notes, and snippets.

@shofel
Created April 2, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shofel/cd3d60820eb6a68b3eac6869e5d13a3e to your computer and use it in GitHub Desktop.
Save shofel/cd3d60820eb6a68b3eac6869e5d13a3e to your computer and use it in GitHub Desktop.
Webpack: print date when compilation starts and finishes.
/**
* Print time when watching.
*/
class PrintTimePlugin {
apply (compiler) {
compiler.hooks.done.tap(
'PrintTimePlugin',
_ => console.log('done', ShortDate(), '\n'))
compiler.hooks.compile.tap(
'PrintTimePlugin',
_ => console.log('start', ShortDate()))
}
}
/**
* Usage.
*
* Add the plugin to the plugin list.
*/
plugins: [new PrintTimePlugin()]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment