-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
38 lines (35 loc) · 966 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { sveltekit } from "@sveltejs/kit/vite";
import tailwindcss from "@tailwindcss/vite";
import { uneval } from "devalue";
import { defineConfig } from "vite";
import glsl from "vite-plugin-glsl";
import { ViteImageOptimizer } from "vite-plugin-image-optimizer";
import YAML from "yaml";
const YAML_REGEX = /\.ya?ml$/;
export default defineConfig({
plugins: [
glsl(),
tailwindcss(),
ViteImageOptimizer({
webp: { minSize: true, mixed: true },
includePublic: true,
// exclude animated
test: /^((?!\b(borpa_spin|cube|cat_fine)\.).)+\.(png|webp|jpe?g|avif)$/,
}),
sveltekit(),
{
name: "yaml",
enforce: "pre",
transform(src, id) {
if (!YAML_REGEX.exec(id)) return;
return { code: "export default " + uneval(YAML.parse(src)) + ";" };
},
},
],
server: {
fs: {
// Allow serving files from one level up to the project root
allow: [".."],
},
},
});