Files
radicle-explorer/vite.config.ts
T
Rūdolfs Ošiņš 41eac34ddc Don't reload the dev app on E2E test output
Playwright traces written to tests/artifacts kept reloading the app
running in `npm run tauri dev`.
2026-10-06 15:53:56 +02:00

48 lines
1.2 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/**",
"**/tests/artifacts/**",
"**/tests/tmp/**",
],
},
},
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/"),
},
},
});