45 lines · 1.5 KB · TypeScript
RawDownload
import { defineConfig, type Plugin } from "vite";import { cloudflare } from "@cloudflare/vite-plugin";import { tanstackStart } from "@tanstack/react-start/plugin/vite";import react from "@vitejs/plugin-react";import tailwindcss from "@tailwindcss/vite";import executorVitePlugin from "@executor-js/vite-plugin"; // Dev-only: the cloudflare vite-plugin bridges outbound fetches (JWKS,// OAuth metadata proxy, etc.) through node undici in the host process. If// a pooled keep-alive socket gets RST'd while no listener is attached, the// `'error'` emit is unhandled and tears down the whole dev server. Log// enough to identify the offender and keep the server alive.const devCrashGuard = (): Plugin => {  let installed = false;  const install = () => {    if (installed) return;    installed = true;    process.on("uncaughtException", (err, origin) => {      console.error(        `[dev-crash-guard] uncaughtException (origin=${origin}):`,        err,      );    });    process.on("unhandledRejection", (reason, promise) => {      console.error("[dev-crash-guard] unhandledRejection:", reason, promise);    });  };  return {    name: "dev-crash-guard",    apply: "serve",    configureServer: install,  };}; export default defineConfig({  resolve: { tsconfigPaths: true },  plugins: [    devCrashGuard(),    tailwindcss(),    executorVitePlugin(),    cloudflare({ viteEnvironment: { name: "ssr" }, inspectorPort: false }),    tanstackStart(),    react(),  ],});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t