mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +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";
|
import purgecss from "@fullhuman/postcss-purgecss";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// 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()],
|
plugins: [svelte()],
|
||||||
css: {
|
css: {
|
||||||
postcss: {
|
postcss: {
|
||||||
@@ -15,4 +18,10 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
plugins: [svelte()],
|
||||||
|
};
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user