Created
April 2, 2018 13:51
-
-
Save shofel/cd3d60820eb6a68b3eac6869e5d13a3e to your computer and use it in GitHub Desktop.
Webpack: print date when compilation starts and finishes.
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
/** | |
* 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