UNPKG
critters-webpack-plugin
Version:
latest (3.0.2)
legacy (1.3.5)
3.0.2
3.0.1
3.0.0
2.5.0
2.4.0
2.3.0
2.2.0
2.1.3
2.1.2
2.1.1
2.1.0
2.0.1
2.0.0
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
Webpack plugin to inline critical CSS and lazy-load the rest.
GoogleChromeLabs/critters
critters-webpack-plugin
/
src
/
util.js
9 lines
(8 loc)
•
278 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
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); } }