123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- 'use strict';
- const AsyncSeriesWaterfallHook = require('tapable').AsyncSeriesWaterfallHook;
- const htmlWebpackPluginHooksMap = new WeakMap();
- function getHtmlWebpackPluginHooks (compilation) {
- let hooks = htmlWebpackPluginHooksMap.get(compilation);
-
- if (hooks === undefined) {
- hooks = createHtmlWebpackPluginHooks();
- htmlWebpackPluginHooksMap.set(compilation, hooks);
- }
- return hooks;
- }
- function createHtmlWebpackPluginHooks () {
- return {
- beforeAssetTagGeneration: new AsyncSeriesWaterfallHook(['pluginArgs']),
- alterAssetTags: new AsyncSeriesWaterfallHook(['pluginArgs']),
- alterAssetTagGroups: new AsyncSeriesWaterfallHook(['pluginArgs']),
- afterTemplateExecution: new AsyncSeriesWaterfallHook(['pluginArgs']),
- beforeEmit: new AsyncSeriesWaterfallHook(['pluginArgs']),
- afterEmit: new AsyncSeriesWaterfallHook(['pluginArgs'])
- };
- }
- module.exports = {
- getHtmlWebpackPluginHooks
- };
|