UNPKG

beasties-webpack-plugin

Version:

Webpack plugin to inline critical CSS and lazy-load the rest.

10 lines (9 loc) 277 B
export function tap(inst, hook, pluginName, async, callback) { if (inst.hooks) { const camel = hook.replace(/-([a-z])/g, (s, i) => i.toUpperCase()) inst.hooks[camel][async ? 'tapAsync' : 'tap'](pluginName, callback) } else { inst.plugin(hook, callback) } }