@leadconnector/vite-tanstack-config
v0.3.3
Published
Shared Vite configuration for LeadConnector TanStack Start previews. Requires Vite 7 or 8, matching the supported `@tanstack/react-start` peer. The standalone tagger, HMR gate, and dev-server bridge packages continue to support Vite 5 through 8.
Keywords
Readme
@leadconnector/vite-tanstack-config
Shared Vite configuration for LeadConnector TanStack Start previews.
Requires Vite 7 or 8, matching the supported @tanstack/react-start peer.
The standalone tagger, HMR gate, and dev-server bridge packages continue to
support Vite 5 through 8.
Usage
import { defineConfig } from "@leadconnector/vite-tanstack-config";
export default defineConfig({
hmrGate: true,
devServerBridge: true,
vite: {
// Any Vite UserConfig fields.
},
});defineConfig also accepts a plain Vite config, a Vite config function, or a
promise:
export default defineConfig(({ mode }) => ({
base: mode === "development" ? "/" : "/app/",
}));Sandbox behavior
A sandbox is detected with VIBE_SANDBOX=1.
- The HMR gate and dev-server bridge are enabled for
serveunless explicitly set tofalse. Outside a sandbox they requiretrueor an options object. - Sandbox networking is fixed to host
::, port8080, and strict port mode. HMR overlays are disabled when HMR is enabled (server.hmris{ overlay: false }only). Deprecated websocket fields onserver.hmrare not forwarded; leaveserver.wsto Vite (default timeout is 30s). An explicitserver.hmr: falseremains disabled. server.headers, customserver.cors, andserver.proxyare warned about and removed.allowedHostsis never set totrueand always includes.modal.hostfor secure Modal tunnel previews. Add other preview hostnames withVIBE_PREVIEW_HOST(one URL/hostname) orVIBE_PREVIEW_HOSTS(comma-separated); invalid values are rejected.
Bundled dev is disabled by default. It is enabled only for sandbox serve
when VIBE_FEATURE_BUNDLED_DEV=true and the installed Vite is a stable
version at least 8.1. Unsupported, prerelease, and unresolved versions warn
and use classic dev.
Options
hmrGate:boolean | HmrGateOptionsdevServerBridge:boolean | DevServerBridgeOptionsssrErrorLogger/serverFnErrorLogger: set tofalseto disable the corresponding platform diagnosticsenvDefine: set tofalseto omit loadedVITE_definitionsnitro: opt in outside a sandbox withtrueor an options object; sandbox builds retain the package's existing required Nitro policytanstackStart,react,plugins, andvite: additional plugin/config options merged with the internal defaults
