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

@oro.ad/nuxt-claude-devtools-bc

v1.0.5

Published

Nuxt module for automatic Vite dev server configuration with tunnels (Cloudflare, ngrok, etc.) and DevTools integration

Readme

@oro.ad/nuxt-claude-devtools-bc

npm version npm downloads License Nuxt

Nuxt module for automatic Vite dev server configuration with tunnels (Cloudflare, ngrok, etc.) and DevTools integration for Business Console.

Problem

When running Nuxt dev server through a tunnel (e.g., bc-xxx.domain.com -> localhost:3000):

  1. MIME type errors - Vite serves CSS as module script
  2. HMR doesn't work - WebSocket tries to connect to localhost instead of public domain
  3. Modules don't load - origin points to localhost
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css"
WebSocket connection to 'wss://localhost:5173/_nuxt/' failed
[vite] failed to connect to websocket

Solution

This module automatically configures Vite dev server for tunnel environments by reading the DEV_TUNNEL_HOST environment variable.

Features

  • Automatic Vite dev server configuration for tunnels
  • Support for Cloudflare Tunnel, ngrok, and other reverse proxies
  • Nuxt DevTools integration with tunnel status display
  • Auto-disable DevTools authorization for tunnel access
  • useTunnel() composable for runtime access to tunnel config
  • Environment variable and config-based configuration

Quick Setup

  1. Add @oro.ad/nuxt-claude-devtools-bc dependency to your project
npm install @oro.ad/nuxt-claude-devtools-bc
  1. Add module to nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@oro.ad/nuxt-claude-devtools-bc'],
})
  1. Run with tunnel host
# Option 1: Inline environment variable
DEV_TUNNEL_HOST=my-app.trycloudflare.com npm run dev

# Option 2: .env.local (gitignored)
echo "DEV_TUNNEL_HOST=my-app.trycloudflare.com" > .env.local
npm run dev

Configuration

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | DEV_TUNNEL_HOST | Public tunnel domain (without protocol) | - | | DEV_TUNNEL_PROTOCOL | Protocol (http or https) | https | | DEV_TUNNEL_PORT | HMR WebSocket port | 443 for https, 80 for http |

nuxt.config.ts Options

export default defineNuxtConfig({
  modules: ['@oro.ad/nuxt-claude-devtools-bc'],

  claudeDevtoolsBc: {
    tunnel: {
      // Explicit host (overrides env variable)
      host: 'my-tunnel.domain.com',
      protocol: 'https',
      port: 443,

      // Additional allowed hosts
      additionalHosts: ['staging.domain.com'],

      // Disable tunnel configuration
      enabled: true,
    },

    // Enable/disable DevTools tab
    devtools: true,

    // Auto-disable DevTools authorization when tunnel is active (default: true)
    // Set to false to keep authorization enabled
    disableDevtoolsAuth: true,
  },
})

DevTools Authorization

When a tunnel is configured, the module automatically disables Nuxt DevTools authorization. This is required because DevTools auth doesn't work through tunnels/proxies.

To keep authorization enabled (not recommended for tunnel usage):

claudeDevtoolsBc: {
  disableDevtoolsAuth: false,
}

Usage

useTunnel() Composable

Access tunnel configuration in your components:

<script setup>
const tunnel = useTunnel()
</script>

<template>
  <div v-if="tunnel.isActive.value">
    Tunnel active: {{ tunnel.origin.value }}
  </div>
</template>

DevTools Integration

Open Nuxt DevTools and navigate to the "Claude BC" tab to see:

  • Current tunnel status
  • Connection details (host, protocol, HMR config)
  • Environment variables

Testing with Cloudflare Tunnel

# Terminal 1: Start tunnel
cloudflared tunnel --url http://localhost:3000
# Get URL like: https://random-words.trycloudflare.com

# Terminal 2: Start Nuxt
DEV_TUNNEL_HOST=random-words.trycloudflare.com npm run dev

Business Console Integration

For Business Console spawner scripts:

#!/bin/bash
SESSION_CODE=$1
DEV_DOMAIN=$2

export DEV_TUNNEL_HOST="bc-${SESSION_CODE}.${DEV_DOMAIN}"
npm run dev

What This Module Configures

When DEV_TUNNEL_HOST is set, the module automatically configures:

Vite Dev Server

{
  vite: {
    server: {
      allowedHosts: [tunnelHost, 'localhost'],
      origin: `https://${tunnelHost}`,
      hmr: {
        protocol: 'wss',
        host: tunnelHost,
        clientPort: 443
      }
    }
  }
}

DevTools Authorization

{
  devtools: {
    disableAuthorization: true  // Allows access through tunnel
  }
}

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with playground
npm run dev

# Run ESLint
npm run lint

# Build
npm run prepack