Files
drive/apps/drive-web/vite.config.ts
kenneth acfe1523df refactor: wrap all errors in ConvexError
- Update error() helper to throw ConvexError instead of plain objects
- Add isApplicationConvexError() type guard for client-side error checking
- Fix Vite config to include convex/values in optimizeDeps for proper instanceof checks
- Update error handling to check ConvexError wrapper and extract data property

This ensures all application errors are properly typed and can be identified
using instanceof ConvexError on the client side.

Co-authored-by: Ona <no-reply@ona.com>
2025-11-08 17:56:28 +00:00

31 lines
831 B
TypeScript

import path from "node:path"
import tailwindcss from "@tailwindcss/vite"
import { TanStackRouterVite } from "@tanstack/router-plugin/vite"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
export default defineConfig({
plugins: [TanStackRouterVite(), react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
port: 3000,
host: true,
fs: {
allow: [".."],
},
},
optimizeDeps: {
include: ["convex/react", "convex/values", "convex-helpers"],
// Workaround for better-auth bug: https://github.com/better-auth/better-auth/issues/4457
// Vite's esbuild incorrectly transpiles better-call dependency causing 'super' keyword errors
exclude: ["better-auth", "@convex-dev/better-auth"],
esbuildOptions: {
target: "esnext",
},
},
})