esbuild-plugin-purgecss-2
based on esbuild-plugin-purgecss
Description
This allows you to pass content (html/css) in the plugin.
Why I created this?
Please read here: How To Setup Custom ESBuild with SCSS, PurgeCSS & LiveServer?
Usage
npm i -D esbuild-plugin-purgecss-2
const glob = require("glob-all");
const purgecssPlugin2 = require("esbuild-plugin-purgecss-2")
esbuild.build({
...,
plugins: [
purgecssPlugin2({
content: glob.sync([
"./*.html",
"./views/**/*.html",
"./src/scripts/*.js",
"./src/scripts/**/*.js",
])
})
]
})
Complete Example on How to Setup a Custom ESBuild with SCSS, PurgeCSS & LiveServer?
Please refer to my github repository: custom-esbuild-with-scss-purgecss-and-liveserver