Skip to content

Instantly share code, notes, and snippets.

@hamitkera
hamitkera / openInEditorMiddleware.ts
Created May 20, 2026 16:11
Tanstack Devtools Open Editor Plugin
import path from "node:path"
import type { IncomingMessage, ServerResponse } from "node:http"
import type { Plugin } from "vite"
export type OpenInEditorOptions = {
/**
* Editor command for `launch-editor` (e.g. `cursor`, `code`, `webstorm`).
* Falls back to `LAUNCH_EDITOR` env, then `cursor`.
*/
editor?: string