Load dsv plugin

This commit is contained in:
Niek van der Maas 2023-03-23 12:59:02 +01:00
parent 818dc492c6
commit c15517a3fd
1 changed files with 5 additions and 2 deletions

View File

@ -1,14 +1,17 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte' import { svelte } from '@sveltejs/vite-plugin-svelte'
import dsv from '@rollup/plugin-dsv'
import purgecss from '@fullhuman/postcss-purgecss' import purgecss from '@fullhuman/postcss-purgecss'
const plugins = [svelte(), dsv()]
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(({ command, mode, ssrBuild }) => { export default defineConfig(({ command, mode, ssrBuild }) => {
// Only run PurgeCSS in production builds // Only run PurgeCSS in production builds
if (command === 'build') { if (command === 'build') {
return { return {
plugins: [svelte()], plugins,
css: { css: {
postcss: { postcss: {
plugins: [ plugins: [
@ -22,7 +25,7 @@ export default defineConfig(({ command, mode, ssrBuild }) => {
} }
} else { } else {
return { return {
plugins: [svelte()] plugins
} }
} }
}) })