28 lines
591 B
TypeScript
28 lines
591 B
TypeScript
/// <reference types="vite/client" />
|
|
|
|
import preact from "@preact/preset-vite";
|
|
import { defineConfig } from "vite";
|
|
|
|
import postCSSPurgeCSS from "@fullhuman/postcss-purgecss";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
css: {
|
|
...(import.meta.env.NODE_ENV === "production"
|
|
? {
|
|
transformer: "postcss",
|
|
postcss: {
|
|
plugins: [
|
|
postCSSPurgeCSS({
|
|
content: ["./index.html", "./src/**/*.{ts,tsx}"],
|
|
}),
|
|
],
|
|
},
|
|
}
|
|
: { transformer: "lightningcss" }),
|
|
},
|
|
build: {
|
|
cssMinify: "lightningcss",
|
|
},
|
|
plugins: [preact()],
|
|
});
|