npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vite-plugin-tailscale

v0.1.2

Published

A Vite plugin that exposes the dev server via Tailscale Serve or Funnel when --tailscale is passed

Downloads

301

Readme

vite-plugin-tailscale

A Vite plugin that exposes your dev server through Tailscale. By default it uses Tailscale Serve (Tailnet only). Tailscale Funnel (public internet) is available but must be enabled explicitly.

The plugin only runs when the --tailscale argument is passed to the Vite dev command, so it stays out of the way during normal development.

Install

pnpm add -D vite-plugin-tailscale

Usage

Add the plugin to your Vite config:

import { defineConfig } from 'vite'
import tailscale from 'vite-plugin-tailscale'

export default defineConfig({
  plugins: [
    tailscale(),
  ],
})

Start the dev server with the --tailscale flag:

pnpm vite --tailscale

Your dev server is now reachable at https://<your-machine>.<tailnet>.ts.net from any device on your Tailnet.

Options

tailscale({
  /**
   * Exposure mode.
   * - `'serve'` (default): Tailnet only.
   * - `'funnel'`: public internet. Must be enabled explicitly.
   */
  mode: 'serve',

  /**
   * Tailscale hostname used in the printed URL.
   * When omitted, the plugin tries to auto-detect it from `tailscale status --json`.
   */
  hostname: undefined,

  /**
   * Auto-detect the Tailscale hostname.
   */
  autoDetectHostname: true,

  /**
   * Local port to expose. Defaults to the port Vite binds to.
   */
  port: undefined,

  /**
   * Tailscale HTTPS server port. Mirrors the `--https <PORT>` CLI flag so the
   * Tailnet URL becomes `https://<hostname>:<httpsPort>`.
   */
  httpsPort: undefined,

  /**
   * Disable the plugin entirely.
   */
  disabled: false,

  /**
   * CLI argument that enables Tailscale exposure.
   */
  enableArg: '--tailscale',

  /**
   * Environment variables to set once the Tailscale hostname is known.
   *
   * Each entry can be a string (env var name, defaults to the full URL)
   * or an object with `name` and `value`.
   *
   * - `value: 'url'`: full URL, e.g. `https://my-machine.tailnet-abc.ts.net:771`
   * - `value: 'host'`: hostname with optional port, e.g. `my-machine.tailnet-abc.ts.net:771`
   */
  env: undefined,

  /**
   * Run one or more hooks after Tailscale starts and its hostname is known.
   * Hooks may be async. Failures are logged without stopping the dev server.
   */
  hooks: undefined,
})

Hooks

Hooks receive the Tailscale hostname and a context containing the full URL, local port, HTTPS port, and exposure mode. For example, you can update a Convex environment variable with the exposed app URL:

import { execFileSync } from 'node:child_process'
import { defineConfig } from 'vite'
import tailscale from 'vite-plugin-tailscale'

export default defineConfig({
  plugins: [
    tailscale({
      hooks: (_hostname, { url }) => {
        execFileSync('pnpm', ['exec', 'convex', 'env', 'set', 'APP_URL', url], {
          stdio: 'inherit',
        })
      },
    }),
  ],
})

You can pass an array when multiple integrations need to run:

tailscale({
  hooks: [
    (hostname) => console.log(`Tailscale hostname: ${hostname}`),
    async (_hostname, { url }) => updateExternalService(url),
  ],
})

Funnel

To expose the dev server publicly via Tailscale Funnel:

import { defineConfig } from 'vite'
import tailscale from 'vite-plugin-tailscale'

export default defineConfig({
  plugins: [
    tailscale({ mode: 'funnel' }),
  ],
})
pnpm vite --tailscale

A warning is printed to remind you that the server is now public.

Requirements

  • Tailscale must be installed, running, and logged in.
  • Funnel mode requires Funnel to be enabled for your tailnet.

Publishing

Maintainer setup and tag-based release instructions are documented in PUBLISHING.md. npm publication only runs for a pushed version tag whose name exactly matches the version in package.json.

License

MIT