What worked for me:
import htmlPurge from "vite-plugin-html-purgecss"; export default { plugins: [ (htmlPurge as any).default(), } }