A powerful, feature-rich boilerplate for building cross-browser extensions using React, TypeScript, Tailwind CSS, and Vite. Designed for modern web development with first-class developer experience.
# Clone the repository
git clone https://github.com/hirendhola/Vite-React-TypeScript-Tailwind-CSS-Extension-Boilerplate.git
# Install dependencies
npm install
# Development
npm run dev:chrome # Chrome development
npm run dev:firefox # Firefox development
npm run dev:safari # Safari development
npm run dev:all # Develop for all browsers
# Building
npm run build:chrome # Build for Chrome
npm run build:firefox # Build for Firefox
npm run build:safari # Build for Safari
npm run build:all # Build for all browsers
# Packaging
npm run pack:all # Create distribution packages
src/
โโโ components/ # Reusable UI components
โ โโโ ui/ # Shadcn/ui components
โโโ lib/ # Utility functions
โ โโโ browser-api.ts # Browser API abstraction
โ โโโ utils.ts # Helper functions
โโโ popup/ # Extension popup interface
โโโ content/ # Content scripts
โโโ background/ # Service worker
โโโ manifest/ # Browser-specific manifests
// Unified API calls across browsers
import browserAPI from '@/lib/browser-api';
// Works in Chrome, Firefox, and Safari
await browserAPI.storage.local.set({ key: 'value' });
await browserAPI.tabs.query({ active: true });
// Type-safe message passing between components
browserAPI.runtime.sendMessage({
type: 'ACTION_TYPE',
payload: data,
});
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.