Skip to content
Source
Sign inSign up
fuko/trytanstackdb-v2
Open History to see the last commit

vite.config.ts

42 lines1.4 KB

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 ignorePatterns: ["src/routeTree.gen.ts", ".intent/**", ".claude/**", ".codex/**"],
16 jsPlugins: [{ name: "vite-plus", specifier: "vite-plus/oxlint-plugin" }],
17 rules: { "vite-plus/prefer-vite-plus-imports": "error" },
18 options: { typeAware: true, typeCheck: true },
19 },
20 resolve: { tsconfigPaths: true },
21 // The dev server is also opened from other devices over Tailscale, by
22 // machine name (`http://pop-os:3000`) or MagicDNS name (`*.ts.net`).
23 server: { allowedHosts: ["pop-os", ".ts.net"] },
24 test: {
25 include: ["src/**/*.test.{ts,tsx}"],
26 },
27 plugins: lazyPlugins(() =>
28 // Unit tests only cover plain TypeScript; they don't need the app's build plugins
29 // (the Cloudflare plugin in particular can't run inside Vitest).
30 process.env.VITEST
31 ? []
32 : [
33 devtools(),
34 cloudflare({ viteEnvironment: { name: "ssr" } }),
35 tailwindcss(),
36 tanstackStart(),
37 viteReact(),
38 ],
39 ),
40});
41​
42export default config;