Only run PurgeCSS in production builds
This commit is contained in:
parent
baac66327e
commit
5a0d6b7561
|
@ -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()],
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue