mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-13 16:04:05 +09:00
Only run PurgeCSS in production builds
This commit is contained in:
@@ -4,7 +4,10 @@ import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||
import purgecss from "@fullhuman/postcss-purgecss";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
export default defineConfig(({ command, mode, ssrBuild }) => {
|
||||
// Only run PurgeCSS in production builds
|
||||
if (command === "build") {
|
||||
return {
|
||||
plugins: [svelte()],
|
||||
css: {
|
||||
postcss: {
|
||||
@@ -15,4 +18,10 @@ export default defineConfig({
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
plugins: [svelte()],
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user