LogAfterCompilePlugin.js 596 B

12345678910111213141516171819
  1. class LogAfterCompilePlugin {
  2. constructor(param = {}) {
  3. this.word = param.word
  4. }
  5. apply(compiler) {
  6. let word = this.word || '勇敢的少年啊快去创造奇迹!'
  7. compiler.hooks.done.tapAsync('LogAfterCompilePlugin', (stat, callback) => {
  8. console.log('==============================');
  9. console.log(` ${word} `);
  10. console.log('==============================');
  11. console.log('耗时:', stat.endTime - stat.startTime);
  12. callback();
  13. });
  14. }
  15. }
  16. module.exports = LogAfterCompilePlugin;