Open History to see the last commit
1import { defineConfig, lazyPlugins } from "vite-plus";
2import { devtools } from "@tanstack/devtools-vite";
3
4import { tanstackStart } from "@tanstack/react-start/plugin/vite";
5
6import viteReact from "@vitejs/plugin-react";
7import tailwindcss from "@tailwindcss/vite";
8import { cloudflare } from "@cloudflare/vite-plugin";
9
10const config = defineConfig({
11 fmt: {
12 ignorePatterns: ["src/routeTree.gen.ts", ".intent/**", ".claude/**", ".codex/**"],
13 },
14 lint: {
15 // `.source/` holds the TanStack Source CI workflows. They import
16 // `@tanstack-source/ci`, which the forge's runner provides; it is not on npm.
17 ignorePatterns: ["src/routeTree.gen.ts", ".intent/**", ".claude/**", ".codex/**", ".source/**"],
18 jsPlugins: [{ name: "vite-plus", specifier: "vite-plus/oxlint-plugin" }],
19 rules: { "vite-plus/prefer-vite-plus-imports": "error" },
20 options: { typeAware: true, typeCheck: true },
21 },
22 resolve: { tsconfigPaths: true },
23 // The dev server is also opened from other devices over Tailscale, by
24 // machine name (`http://pop-os:3000`) or MagicDNS name (`*.ts.net`).
25 server: { allowedHosts: ["pop-os", ".ts.net"] },
26 test: {
27 include: ["src/**/*.test.{ts,tsx}"],
28 },
29 plugins: lazyPlugins(() =>
30 // Unit tests only cover plain TypeScript; they don't need the app's build plugins
31 // (the Cloudflare plugin in particular can't run inside Vitest).
32 process.env.VITEST
33 ? []
34 : [
35 devtools(),
36 cloudflare({ viteEnvironment: { name: "ssr" } }),
37 tailwindcss(),
38 tanstackStart(),
39 viteReact(),
40 ],
41 ),
42});
43
44export default config;