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

vscode-webview-boilerplate

v1.0.0

Published

Automation script to create VS Code extensions with React + Vite + Tailwind + Shadcn/UI webviews

Readme

VS Code React Webview Boilerplate

🚀 Automated setup script for VS Code extensions with React + Vite + Tailwind CSS + Shadcn/UI webviews.

✨ Features

  • One-command setup - Complete automation from start to finish
  • Modern stack - React 18, TypeScript, Vite, Tailwind CSS, Shadcn/UI
  • Hot reload - Instant feedback during development
  • Production-ready - esbuild bundler with optimized builds
  • Path aliases - Clean imports with @/ prefix
  • Dark mode - Automatic theme integration
  • Example components - Pre-configured Shadcn components (Button, Card)

🚀 Quick Start

Option 1: Use with npx (Recommended)

npx vscode-webview-boilerplate

Option 2: Global Installation

npm install -g vscode-webview-boilerplate
vscode-webview-setup

Option 3: Local Installation

npm install vscode-webview-boilerplate
node node_modules/vscode-webview-boilerplate/setup.js

📋 What It Does

The script automates the entire setup process:

  1. Creates VS Code extension (or adds to existing one)
  2. Sets up React + Vite webview project
  3. Configures TypeScript with path aliases
  4. Installs Tailwind CSS with dark mode support
  5. Sets up Shadcn/UI component library
  6. Copies pre-built components (Button, Card, utils)
  7. Configures bundlers (esbuild for extension, Vite for webview)
  8. Sets up hot reload for instant development feedback
  9. Updates package.json with VS Code contributes
  10. Patches extension.ts with WebviewProvider registration
  11. Creates development tasks for watch mode

🎯 Requirements

  • Node.js 18+
  • npm 7+
  • VS Code (for testing)

💡 Usage

After running the script, you'll be guided through:

  1. Project type - New project or existing extension
  2. Webview configuration - View ID, title, location
  3. Optional setup - Tailwind CSS and Shadcn/UI
  4. Integration - Automatic or manual file updates

New Project

npx vscode-webview-boilerplate
# Choose "Create a new project from scratch"
# Follow the yo code wizard instructions

Existing Extension

cd your-existing-extension
npx vscode-webview-boilerplate
# Choose "I already have an extension project"

🛠️ Post-Setup Commands

# Development mode (watch + hot reload)
npm run watch

# Build for production
npm run compile

# Test extension
Press F5 in VS Code

📦 What's Included

Configuration Files

  • esbuild.js - Extension bundler
  • vite.config.ts - Webview bundler
  • .vscode/tasks.json - Parallel watch tasks
  • tsconfig.json - TypeScript configuration

Template Files

  • WebviewProvider.ts - Webview provider with hot reload
  • App.tsx - React entry point with Shadcn example
  • index.css - Tailwind + Shadcn variables
  • components/ui/ - Shadcn components (Button, Card)
  • lib/utils.ts - Utility functions (cn helper)

🎨 Customization

After setup, you can:

  • Add more Shadcn components: npx shadcn@latest add <component>
  • Modify theme: Edit CSS variables in index.css
  • Add routes: Install react-router-dom for multi-page webviews
  • State management: Add Zustand, Jotai, or Redux
  • API calls: Use vscode.postMessage() for extension communication

🔧 Troubleshooting

Build errors

npm run clean  # Remove dist folder
npm run compile

Webview not loading

  • Check browser console in webview (Ctrl+Shift+I)
  • Verify dist/webview/ contains built files
  • Ensure view ID matches in all files

Hot reload not working

  • Restart watch mode: npm run watch
  • Check terminal for build errors
  • Verify Vite dev server is running on port 5173

📚 Documentation

For detailed technical documentation, see:

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

📄 License

MIT License - See LICENSE for details

🔗 Links