Files
openidea/vite.config.ts
T
Jaw 55836e1b49 chore: Format the codebase with oxfmt and check formatting in CI (#135)
Run oxfmt once over the whole repository (formatting only, no logic changes) and add `pnpm format:check` to the frontend CI job so unformatted code no longer builds up. `.oxfmtrc.json` now skips the generated theme docs, test fixtures and code blocks inside Markdown.

Co-authored-by: jaw52 <53564781+jaw52@users.noreply.github.com>
2026-10-28 19:35:16 +08:00

41 lines
1.2 KiB
TypeScript

/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { fileURLToPath } from "node:url";
import process from "node:process";
const host = process.env.TAURI_DEV_HOST;
export default defineConfig(() => ({
plugins: [react()],
resolve: {
alias: [
{ find: "@", replacement: fileURLToPath(new URL("./src", import.meta.url)) },
// `invoke` with remote-development routing (src/platform/tauriCore.ts).
{
find: /^@tauri-apps\/api\/core$/,
replacement: fileURLToPath(new URL("./src/platform/tauriCore.ts", import.meta.url)),
},
],
},
// Tauri: keep Rust errors visible, fixed port, don't watch the backend.
clearScreen: false,
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host ? { protocol: "ws", host, port: 1421 } : undefined,
watch: { ignored: ["**/src-tauri/**", "**/crates/**", "**/target/**"] },
},
build: {
target: "safari16",
sourcemap: true,
},
test: {
environment: "jsdom",
globals: false,
setupFiles: ["./src/test/setup.ts"],
include: ["src/**/*.test.{ts,tsx}", "perf/**/*.test.ts", "scripts/**/*.test.ts"],
},
}));