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
这些事件是何时如何被运行的?大神指条明路呗?
自己看了半天源码,知道了:
关键点:发布订阅模式;
关键文件:Tapable.js;
关键方法:Tapable.prototype.plugin,Tapable.prototype.applyPluginsWaterfall,Tapable.prototype.applyPluginsAsyncWaterfall