mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-20 22:00:43 +08:00
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.
44 lines
1.1 KiB
TypeScript
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/"),
|
|
},
|
|
},
|
|
});
|