{"id":22600,"library":"vite-plugin-caddy-multiple-tls","title":"vite-plugin-caddy-multiple-tls","description":"Vite plugin (v1.8.1) that runs Caddy alongside Vite to provide local HTTPS with automatic per-branch domains like `<repo>.<branch>.localhost`. Supports Vite 3-8, Node >=22. Ships TypeScript types. Key differentiators: multi-instance isolation via ownership tokens, automatic git-derived hostnames, no /etc/hosts editing needed for `.localhost` domains, and exported helpers (`resolveCaddyTlsDomains`, `resolveCaddyTlsUrl`) for external tooling. Actively maintained with frequent releases addressing crash recovery, port conflicts, and cross-process locks.","status":"active","version":"1.8.1","language":"javascript","source_language":"en","source_url":"https://github.com/vampaz/vite-plugin-caddy-multiple-tls","tags":["javascript","caddy","https","local-development","plugin","tls","vite","typescript"],"install":[{"cmd":"npm install vite-plugin-caddy-multiple-tls","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-caddy-multiple-tls","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-caddy-multiple-tls","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only (Node >=22). CommonJS require will throw.","wrong":"const caddyTls = require('vite-plugin-caddy-multiple-tls')","symbol":"default (caddyTls)","correct":"import caddyTls from 'vite-plugin-caddy-multiple-tls'"},{"note":"Named export, not default. Available since v1.8.0.","wrong":"import resolveCaddyTlsDomains from 'vite-plugin-caddy-multiple-tls'","symbol":"resolveCaddyTlsDomains","correct":"import { resolveCaddyTlsDomains } from 'vite-plugin-caddy-multiple-tls'"},{"note":"Named export, not default. Available since v1.8.0.","wrong":"import resolveCaddyTlsUrl from 'vite-plugin-caddy-multiple-tls'","symbol":"resolveCaddyTlsUrl","correct":"import { resolveCaddyTlsUrl } from 'vite-plugin-caddy-multiple-tls'"}],"quickstart":{"code":"// vite.config.js\nimport { defineConfig } from 'vite';\nimport caddyTls from 'vite-plugin-caddy-multiple-tls';\n\nexport default defineConfig({\n  plugins: [caddyTls()]\n});\n\n// Then run: npx vite\n// Terminal output:\n// 🔒 Caddy is proxying your traffic on https\n// 🌍 https://my-repo.my-branch.localhost","lang":"typescript","description":"Minimal Vite config enabling automatic HTTPS via Caddy with git-derived domain."},"warnings":[{"fix":"Use `instanceLabel`, `domain`, or stop the other server first.","message":"Since v1.7.0, the plugin refuses to take over a hostname already owned by another live Vite server. Previously it silently replaced the other server's route.","severity":"breaking","affected_versions":">=1.7.0"},{"fix":"Ensure Caddy is restarted if routes appear missing. Use `instanceLabel` to avoid collisions.","message":"Since v1.6.0, route IDs are deterministic and stale route/tls entries are replaced only when matching. This may break setups relying on non-deterministic route ordering.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Upgrade Node to v22 or later.","message":"Node >=22.0.0 is required. Older versions will fail with syntax errors due to ESM features.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Keep these defaults or explicitly set `allowedHosts` to include the resolved domain.","message":"The plugin defaults `server.host = true` and `server.allowedHosts = true`. If you override these, custom hostnames may not work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add the resolved domain to your hosts file or use a wildcard DNS resolver.","message":"When using `baseDomain` other than `localhost`, you must configure DNS or /etc/hosts manually. The plugin does not modify system hosts.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `nvm install 22` or upgrade Node to v22+.","cause":"Node version is too old.","error":"Error: The plugin 'vite-plugin-caddy-multiple-tls' requires Node.js >=22.0.0"},{"fix":"Change to `import caddyTls from 'vite-plugin-caddy-multiple-tls'` and ensure your project is ESM.","cause":"Using CommonJS `require()` instead of ESM `import`.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Stop the other server, or set a unique `instanceLabel` or `domain` in plugin options.","cause":"Another Vite instance with the same derived domain is running (since v1.7.0).","error":"Error: Hostname conflict: another live server already owns '<domain>'. Refusing takeover."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}