Tiny, performant, isomorphic library for extracting the critical CSS.
critical this library:
- Is so much smaller, at about 2kb in size.
criticalinstead needs to download a whole browser.
- It works in the browser too, which is useful if you need to store the previous state of the app or a skeleton of it.
- Will output slightly larger strings, as only simple minification techniques are performed.
- Is much faster.
npm install --save critically
This library provides the following interface:
You need to provide either an HTML string or a document object. The document will be cloned, so you can modify it safely via the
;critically.then console.log html, css ;
MIT © Fabio Spampinato