Get the selectors of an html file.
npm i -D purgecss-from-html
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()
import purgeHtml from "purgecss-from-html"
import fs from "fs"
const htmlContent = fs.readFileSync("index.html")
const htmlSelectors = purgeHtml.extract(htmlContent)