Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aofl/html-webpack-purify-internal-css-plugin

Package Overview
Dependencies
Maintainers
2
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aofl/html-webpack-purify-internal-css-plugin

This is a plugin for [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin). It uses [PurifyCSS](https://github.com/purifycss/purifycss) to remove all unused css rules from internal styles of the generated html.

  • 4.0.0-alpha.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
122
increased by106.78%
Maintainers
2
Weekly downloads
 
Created
Source

@aofl/html-webpack-purify-internal-css-plugin

This is a plugin for html-webpack-plugin. It uses PurifyCSS to remove all unused css rules from internal styles of the generated html.

Installation

npm i -D @aofl/html-webpack-purify-internal-css-plugin

Usage

const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPurifyInternalCssPlugin = require('@aofl/html-webpack-purify-internal-css-plugin');

module.export = {
  ...
  plugins: [
    new HtmlWebpackPlugin(),
    new HtmlWebpackPurifyInternalCssPlugin()
  ]
}

Options

level

Level specifies pruning strategy.

optionDescription
autoThis is the default behavior. It prunes unused css rules based on the generated html and the purgeCss options.
whitelistOnly keep whitelisted rules.
allPrune everything
nonePrune nothing. (Useful for development to be able to toggle classes in devtools)
module.export = {
  ...
  plugins: [
    new HtmlWebpackPurifyInternalCssPlugin({
      level: process.env.NODE_ENV === 'development'? 'none': 'auto'
    })
  ]
}

purgeCss

purgeCss options

module.export = {
  ...
  plugins: [
    new HtmlWebpackPurifyInternalCssPlugin({
      level: process.env.NODE_ENV === 'development'? 'none': 'auto',
      purgeCss: {
        whitelist?: Array<string>,
        whitelistPatterns?: Array<RegExp>,
        whitelistPatternsChildren?: Array<RegExp>,
        keyframes?: boolean,
        fontFace?: boolean,
        rejected?: boolean
      }
    })
  ]
}

FAQs

Package last updated on 23 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc