Package Exports
- purgecss-from-html
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (purgecss-from-html) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Purgecss-from-html
Get the selectors of an html file.
Install
npm i -D purgecss-from-html
Usage
Use with Purgecss
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()
Use alone
import purgeHtml from "purgecss-from-html"
import fs from "fs"
const htmlContent = fs.readFileSync("index.html")
const htmlSelectors = purgeHtml.extract(htmlContent)