Fix #36 - added ESlint config with ts-standard + svelte support

This commit is contained in:
Niek van der Maas
2023-03-20 13:42:47 +01:00
parent eef03cd1b6
commit 0d2e3109e8
12 changed files with 2677 additions and 41 deletions

View File

@@ -1,28 +1,28 @@
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import purgecss from "@fullhuman/postcss-purgecss";
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") {
if (command === 'build') {
return {
plugins: [svelte()],
css: {
postcss: {
plugins: [
purgecss({
content: ["./**/*.html", "./**/*.svelte"],
safelist: ["pre", "code"],
}),
],
},
},
};
content: ['./**/*.html', './**/*.svelte'],
safelist: ['pre', 'code']
})
]
}
}
}
} else {
return {
plugins: [svelte()],
};
plugins: [svelte()]
}
}
});
})