Files
chatgpt-web/vite.config.ts
2023-03-03 16:56:19 +01:00

28 lines
607 B
TypeScript

import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import purgecss from "@fullhuman/postcss-purgecss";
// https://vitejs.dev/config/
export default defineConfig(({ command, mode, ssrBuild }) => {
// Only run PurgeCSS in production builds
if (command === "build") {
return {
plugins: [svelte()],
css: {
postcss: {
plugins: [
purgecss({
content: ["./**/*.html", "./**/*.svelte"],
}),
],
},
},
};
} else {
return {
plugins: [svelte()],
};
}
});