Socket
Socket
Sign inDemoInstall

purgecss-from-svelte

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    purgecss-from-svelte

Svelte extractor for purgecss - get all selectors from a svelte file


Version published
Weekly downloads
228
decreased by-15.87%
Maintainers
1
Install size
638 kB
Created
Weekly downloads
 

Readme

Source

purgecss-from-svelte

Build Status CircleCi dependencies Status Codacy Badge npm license

Get the selectors of an Svelte3 file.

Install

npm i -D purgecss-from-svelte

Usage

Use with Purgecss - PostCSS

import Purgecss from "purgecss";
import PurgeSvelte from "purgecss-from-svelte";

const options = {
  content: ["./src/**/*.svelte"],
  extractors: [
    {
      extractor: PurgeSvelte,
      extensions: ["svelte"]
    }
  ]
};

/* Purgecss */
const purgecss = new Purgecss(options);
const result = purgecss.purge();

/* PostCSS */
{
  plugins: [require("@fullhuman/postcss-purgecss")(options)];
}

Use alone

import PurgeSvelte from "purgecss-from-svelte";
import fs from "fs";

const htmlContent = fs.readFileSync("index.html");
const selectors = PurgeSvelte.extract(htmlContent);

Keywords

FAQs

Last updated on 20 Jul 2019

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