mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Playwright traces written to tests/artifacts kept reloading the app running in `npm run tauri dev`.
48 lines
1.2 KiB
TypeScript
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/"),
|
|
},
|
|
},
|
|
});
|