Before getting to React, it's helpful to know what this
does generally in Javascript.
Take the following snippet of code. It's written in ES6 but the principles for this
predate ES6.
class Dog {
constructor() {
/** | |
* A custom Vite plugin for PurgeCSS. The official one and other community plugins | |
* floating around seem to operate on only one CSS file at a time. When inspecting | |
* where a CSS class is used, we may need to consider all the JS and HTML files in | |
* the bundle. | |
*/ | |
import { PurgeCSS, type UserDefinedOptions as PurgeCSSOptions } from 'purgecss'; | |
import { type Plugin } from 'vite'; | |
interface VitePurgeCSSOptions extends Omit<PurgeCSSOptions, 'content' | 'css'> { |
// npm install if | |
const If = require('if'); | |
const f = (c, t, f) => If(c).Then(t).Else(f); |