@pr0ger/vite-plugin-tailscale-funnel
v0.1.2
Published
Vite plugin that starts Tailscale Funnel or Serve when the dev server starts
Maintainers
Readme
@pr0ger/vite-plugin-tailscale-funnel
A Vite plugin that automatically starts Tailscale Funnel or Tailscale Serve when your dev server starts.
Installation
npm install -D @pr0ger/vite-plugin-tailscale-funnelUsage
// vite.config.ts
import { defineConfig } from 'vite';
import { tailscaleFunnel } from '@pr0ger/vite-plugin-tailscale-funnel';
export default defineConfig({
plugins: [
tailscaleFunnel(),
],
});Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| hostname | string | Auto-detected | Your Tailscale hostname (e.g., laptop.tailnet1337.ts.net) |
| autoDetectHostname | boolean | true | Automatically detect hostname from tailscale status --json |
| port | number | Vite's bound port | Port to expose via Funnel/Serve |
| disabled | boolean | process.env.CI === 'true' | Disable the plugin (useful for CI) |
| mode | 'funnel' \| 'serve' | 'funnel' | funnel = public internet, serve = local Tailnet only |
Examples
Basic usage with auto-detected hostname
tailscaleFunnel()Explicit hostname
tailscaleFunnel({
hostname: 'my-machine.tailnet-name.ts.net',
})Local network only (Tailscale Serve)
tailscaleFunnel({
mode: 'serve',
})Custom port
tailscaleFunnel({
port: 3000,
})Disable in specific environments
tailscaleFunnel({
disabled: process.env.NODE_ENV === 'test',
})Requirements
- Tailscale must be installed and running
- For Funnel mode: Funnel must be enabled on your tailnet
License
MIT
