With Rollup

Last updated 6 months ago

Start by installing the Rollup plugin as a dev dependency.

npm i -D rollup-plugin-purgecss
import { rollup } from 'rollup'
import purgecss from 'rollup-plugin-purgecss'
‚Äč
rollup({
entry: 'main.js',
plugins: [
purgecss({
content: ['index.html']
})
]
})