-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
49 lines (46 loc) · 1.31 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
import { join } from "path";
import { sveltekit } from "@sveltejs/kit/vite";
import { partytownVite } from "@builder.io/partytown/utils";
import svg from "@poppanator/sveltekit-svg";
import type { PluginOption } from "vite";
import { purgeCss } from "vite-plugin-svelte-purgecss";
import ldafIcon from "./vite-plugin-ldaf-icon";
import { imagetools } from "vite-imagetools";
import { defineConfig } from "vitest/config";
import blurhash from "./vite-plugin-blurhash";
import bundlestring from "./vite-plugin-import-as-bundle-string";
const plugins: PluginOption[] = [
sveltekit(),
// https://partytown.builder.io/sveltekit
partytownVite({
dest: join(process.cwd(), ".svelte-kit/output/client/~partytown"),
}),
svg(),
blurhash(),
imagetools(),
bundlestring(),
ldafIcon(),
];
if (process.env.NODE_ENV === "production") {
plugins.push(purgeCss());
}
export default defineConfig({
plugins,
test: {
include: ["src/**/*.{test,spec}.{js,ts}"],
globals: true,
environment: "jsdom",
coverage: {
reporter: ["text", "json", "html", "lcov"],
},
setupFiles: ["src/lib/__tests__/setup.ts"],
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "src/variables.scss" as *;',
includePaths: ["./node_modules/@uswds/uswds/packages"],
},
},
},
});