import deno from "@deno/vite-plugin"; import { defineConfig } from "vite"; // vite reads neither deno.json's compilerOptions nor (for the dep scanner) its own oxc config const jsx = { runtime: "automatic", importSource: "@char/aftercare" } as const; // TheoryTab pages can't be read cross-origin, so imports fetch them through here const proxy = { "/hooktheory": { target: "https://www.hooktheory.com", changeOrigin: true, rewrite: (path: string) => path.replace(/^\/hooktheory/, ""), }, }; export default defineConfig({ server: { proxy }, preview: { proxy }, plugins: [deno()], oxc: { jsx }, optimizeDeps: { rolldownOptions: { transform: { jsx } } }, });