Webpack plugin to inline critical CSS and lazy-load the rest. Version 0.4.2, released semi-regularly. Unlike alternatives like Critical or Penthouse, it does NOT use a headless browser, making it fast and lightweight; instead, it inlines all CSS rules used by the document. It integrates with html-webpack-plugin, supports preloading fonts, pruning unused CSS, and works with webpack-dev-server. Ships TypeScript types. Requires Node ^20.0.0 or >=22.0.0.
npm install beasties-webpack-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Webpack configuration with HtmlWebpackPlugin and BeastiesWebpackPlugin showing common options.
Ensure CSS is valid; or use version <0.4.0 if you rely on lenient parsing.
Install html-webpack-plugin@^5.0.0.
Place HtmlWebpackPlugin before Beasties in the plugins array.
Manually refresh the browser after CSS changes during development.
npm install -D html-webpack-plugin
Move new HtmlWebpackPlugin() above new Beasties() in the plugins array.
Add a template or ensure HtmlWebpackPlugin is correctly configured.
Use import Beasties from 'beasties-webpack-plugin' (no braces).