You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 10, 2020. It is now read-only.
then include it in your project by creating a preact.config.js file:
importcriticalCssPluginfrom"preact-cli-plugin-critical-css";exportdefault(config,env)=>{constoptions={// Passed directly to the 'critical' module (this is optional)};criticalCssPlugin(config,env,options);};
Default options
The plugin sets some default options which can be overridden:
constdefaultOptions={// Inline the generated critical-path CSS.inline: true,// Minify critical-path CSS when inlining.minify: true,// Extract inlined styles from referenced stylesheets.extract: false,// Viewport widthwidth: 1280,// Viewport height.height: 600,// Your build directory to find css files.base: path.resolve(env.dest),// The path to a prerendered route. (e.g. index.html)src: filePath,// Write the generated critical-path CSS to this file.dest: filePath};
Configuration
Full list of possible options that are passed to critical are available here.