Files
radicle-explorer/vite.config.ts
T
Rūdolfs Ošiņš 7a42679bdf Share the list search
Issues, patches, commits and the peer selector each had their own
debounce, and issues and patches the same search index. Vitest now
resolves Svelte's browser build, as effects never run in the server one.
2026-10-01 18:20:25 +02:00

44 lines
1.1 KiB
TypeScript

import path from "node:path";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { defineConfig } from "vitest/config";
// https://vitejs.dev/config/
export default defineConfig({
test: {
environment: "happy-dom",
include: ["tests/unit/**/*.test.ts"],
reporters: "verbose",
},
plugins: [
svelte({
// Reference: https://github.com/sveltejs/vite-plugin-svelte/issues/270#issuecomment-1033190138
dynamicCompileOptions({ filename }) {
if (path.basename(filename) === "Clipboard.svelte") {
return { customElement: true };
}
},
}),
],
build: {
outDir: "build",
},
// prevent vite from obscuring rust errors
clearScreen: false,
server: {
port: 1420,
strictPort: true,
watch: {
ignored: ["**/crates/radicle-tauri/**"],
},
},
resolve: {
// Svelte's server build never runs effects, which rune tests need.
conditions: process.env.VITEST ? ["browser"] : undefined,
alias: {
"@app": path.resolve("./src"),
"@bindings": path.resolve("./crates/radicle-types/bindings/"),
},
},
});