Webpack critical css plugin
About
This is a Webpack plugin for generating critical css using penthouse. It
creates a new file in the chunk with suffix .critical
before file extension.
Eg:
Your output: styles.css
New output: styles.critical.css
Install
yarn add --dev webpack-critical-css-plugin
Usage
In your webpack.config.js:
const CriticalCssPlugin = ; const criticalHTML = yourChunk: "file:///" + path // local html file anotherChunk: "https://example.com" // live url; entry: yourChunk: path anotherChunk: path yetAnotherChunk: path ... plugins: ... criticalHTML ...
Author
Mạnh Tài