素材牛VIP会员
HtmlWebpackPlugin源码中的Events执行分析?
 适***的  分类:Node.js  人气:886  回帖:1  发布于6年前 收藏
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

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

讨论这个帖子(1)垃圾回帖将一律封号处理……

Lv3 码奴
霸***空 交互设计师 6年前#1

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

 文明上网,理性发言!   😉 阿里云幸运券,戳我领取