Socket
Socket
Sign inDemoInstall

purgecss

Package Overview
Dependencies
97
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    purgecss

Remove unused css selectors.


Version published
Weekly downloads
679K
decreased by-3.72%
Maintainers
1
Install size
3.35 MB
Created
Weekly downloads
 

Readme

Source

Purgecss

Build Status CircleCi dependencies Status devDependencies Status Codacy Badge Codacy Badge

Purgecss logo

Getting Started

Installation

npm i --save-dev purgecss

Documentation

Usage

import Purgecss from "purgecss"
import purgeHtml from "purgecss-from-html"
const purgeCss = new Purgecss({
    content: ["**/*.html"],
    css: ["**/*.css"],
    extractors: [
        {
            extractor: purgeHtml,
            extensions: ["html"]
        }
    ]
})
const result = purgecss.purge()
Build Plugin

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning.

License

This project is licensed under the MIT License - see the LICENSE file for details

Troubleshooting

Wrong extractor is selected

The extractors needs to be defined from the more specific to the less specific. Meaning that you need to define js extractor after ejs. So the js extractor will not be selected for ejs files.

You can specified extensions like .es.js.

Some unused css are not removed

If you are using the default or legacy extractor, look here. Head over the repository of the extractor and open an issue. Be as precise as possible when describing the issue, provide the css file and content file if possible.

Keywords

FAQs

Last updated on 11 Jul 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc