@roots/critical-css-webpack-plugin
Version:
Webpack plugin for generating critical-path CSS
41 lines (40 loc) • 1.06 kB
TypeScript
import type { Options } from '@roots/critical-css-webpack-plugin';
import Webpack from 'webpack';
/**
* CriticalCSSWebpackPlugin
*/
export default class CriticalCssWebpackPlugin {
/**
* Plugin options
*/
options: Options;
/**
* Plugin ident
*/
plugin: {
name: string;
stage: number;
};
/**
* Class constructor
*
* @param options - The options for the plugin.
*/
constructor(options?: Options);
/**
* Webpack apply hook
*
* @remarks
* This method is called when the plugin is applied to a {@link Webpack.Compiler | Compiler}.
*
* @param compiler - The {@link Webpack.Compiler | Compiler}.
*/
apply(compiler: Webpack.Compiler): Promise<void>;
/**
* Process assets
*
* @param compilation - The {@link Webpack.Compilation | Compilation}.
* @returns A function that processes the assets.
*/
makeProcessAssetsHook(compilation: Webpack.Compilation): (assets: Webpack.Compilation["assets"]) => Promise<void>;
}