Skip to content

lili21/critical-css-webpack-plugin

Repository files navigation

Critical-Css-Webpack-Plugin

webpack plugin for critical css, based on critical, with publicPath supportive.

Installation

$ yarn add critical-css-webpack-plugin --dev

Usage

webpack.config.js

const CriticalCssPlugin = require('critical-css-webpack-plugin')

...
plugins: [
  new CriticalCssPlugin()
]
...

Options

same as critical options

default options

{
  base: {webpack.output.path},
  src: 'index.html',
  target: 'index.html',
  inline: true,
  extract: true,
  width: 375,
  height: 565,
  css: [/* all css assets emit by webpack */]
}

You pass options to overwrite default value.

webpack.config.js

...
plugins: [
  new CriticalCssPlugin({
    // your options
  })
]
...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •