HtmlWebpackPlugin源码中的Events执行分析?

To allow other plugins to alter the html this plugin executes the following events:
Async:
html-webpack-plugin-before-html-generation
html-webpack-plugin-before-html-processing
html-webpack-plugin-alter-asset-tags
html-webpack-plugin-after-html-processing
html-webpack-plugin-after-emit
Sync:
html-webpack-plugin-alter-chunks

这些事件是何时如何被运行的?大神指条明路呗?

阅读 2.4k
1 个回答

自己看了半天源码,知道了:
关键点:发布订阅模式;
关键文件:Tapable.js;
关键方法:Tapable.prototype.plugin,Tapable.prototype.applyPluginsWaterfall,Tapable.prototype.applyPluginsAsyncWaterfall

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题