purge-from-html
v1.0.3
Published
Html extractor for purgecss - get all selectors from a html file
Downloads
1,553
Maintainers
Readme
Purgecss-from-html
Get the selectors of an html file.
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)