Framework-Free: A "bleeding-edge" Chrome extension template built from the ground up using Vite 8 Beta (Rolldown) and the Oxc toolchain. Unlike many templates that rely on extension frameworks (like WXT, CRXJS, or Plasmo), this project is "hand rolled", giving you full control and maximum performance with the latest web standards and dev tooling.
A modern, production-ready "Hello World" demonstrating all 8 major extension features using a high-performance tech stack: Vite 8 (Beta w/ Rolldown), React 19, Tailwind 4, Zod 4, and Oxc dev tooling.
This template implements every major Chrome Extension capability:
| Feature | Description |
|---|---|
| ๐ฒ Action Popup | Click the toolbar icon for a quick UI with greeting and click counter |
| ๐ Side Panel | Persistent panel that survives tab navigation with real-time state |
| โ๏ธ Options Page | Full settings page with theme selector, notifications toggle, custom greeting |
| ๐ง Background Service Worker | Event-driven brain handling messages, menus, and commands |
| ๐ Content Scripts | Injected into every page for DOM access and highlighting |
| ๐ฑ๏ธ Context Menus | Right-click menu items on text selections and the extension icon |
| โจ๏ธ Keyboard Shortcuts | Alt+Shift+S to toggle side panel, Alt+Shift+D for Demo notifications |
| ๐ Notifications | System-level alerts triggered by shortcuts and context menus |
| Category | Tool | Why |
|---|---|---|
| Build | Vite 8 Beta + Rolldown | Bleeding-edge bundler, ~10x faster builds |
| UI | React 19 | Latest stable with concurrent features |
| Styling | Tailwind CSS 4 | CSS-first config, no JS config file |
| Types | tsgo | TypeScript 7 Native Preview, 10x faster |
| Linting | oxlint | 50-100x faster than ESLint |
| Formatting | oxfmt | 30x faster than Prettier |
| Testing | Vitest | Native Vite integration |
| Validation | Zod 4 | Runtime type validation for storage |
# Clone the repo
git clone https://github.com/GitMurf/chrome-extension-template.git
cd chrome-extension-template
# Install dependencies
pnpm install
# Build the extension
pnpm build- Open
chrome://extensions/ - Enable Developer mode (toggle in top-right)
- Click Load unpacked
- Select the
dist/folder
chrome-extension-template/
โโโ public/
โ โโโ manifest.json # Extension manifest (Manifest V3)
โ โโโ images/ # Extension icons (16, 48, 128px)
โโโ src/
โ โโโ background/ # Service Worker (Feature 4)
โ โโโ content/ # Content Script (Feature 5)
โ โโโ popup/ # Action Popup UI (Feature 1)
โ โโโ sidepanel/ # Side Panel UI (Feature 2)
โ โโโ options/ # Options Page UI (Feature 3)
โ โโโ shared/ # Shared code
โ โโโ storage/ # Zod schemas + typed helpers
โ โโโ messaging/ # Type-safe message protocol
โ โโโ hooks/ # React hooks (useTheme)
โโโ __tests__/ # Vitest tests with Chrome API mocks
โโโ vite.config.ts # Multi-entry build config
โโโ vitest.config.ts # Test configuration
โโโ tsconfig.json # Strict TypeScript
โโโ oxlint.json # Linter rules
โโโ .oxfmtrc.json # Formatting rules
| Shortcut | Action |
|---|---|
Alt+Shift+E |
Open Popup |
Alt+Shift+S |
Toggle Side Panel |
Alt+Shift+D |
Show Demo Notification |
Customize shortcuts at
chrome://extensions/shortcuts
# Watch mode (rebuilds on save)
pnpm dev
# Lint (oxlint)
pnpm lint
# Format (oxfmt)
pnpm fmt
# Type check (tsgo)
pnpm typecheck
# Run tests
pnpm test
# Build for testing in Chrome
pnpm buildAfter running pnpm dev, reload the extension in Chrome (Ctrl+R on the extensions page) to see changes.
Edit public/manifest.json:
{
"name": "Your Extension Name",
"description": "Your description here"
}- Add to
src/shared/messaging/types.ts:
export interface MessageMap {
// ... existing messages
YOUR_MESSAGE: { payload: { data: string }; response: { success: boolean } };
}- Handle in
src/background/index.ts:
case 'YOUR_MESSAGE':
// Handle your message
return { success: true };Edit src/shared/storage/schemas.ts with Zod:
export const SettingsSchema = z.object({
// ... existing fields
yourNewField: z.string().default('value'),
});pnpm buildThe dist/ folder contains everything needed for Chrome Web Store submission:
manifest.jsonbackground.jscontent.jssrc/popup/index.htmlsrc/sidepanel/index.htmlsrc/options/index.htmlimages/assets/
| API | Permission | Usage |
|---|---|---|
chrome.storage.local |
storage |
Persistent settings |
chrome.storage.session |
storage |
Session state (click count) |
chrome.sidePanel |
sidePanel |
Side panel UI |
chrome.contextMenus |
contextMenus |
Right-click menus |
chrome.notifications |
notifications |
System alerts |
chrome.commands |
โ | Keyboard shortcuts |
chrome.runtime |
โ | Message passing |
chrome.tabs |
activeTab |
Tab communication |
- Built with modern tooling from the Oxc project and the Vite ecosystem.
- Used the following Guides and Templates for inspiration:
- https://www.artmann.co/articles/building-a-chrome-extension-with-vite-react-and-tailwind-css-in-2025
- https://medium.com/@jamesprivett29/02-building-a-chrome-extension-template-using-vite-react-and-typescript-d5d9912f1b40
- https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite
- https://github.com/JohnBra/vite-web-extension
- See my Tweets on X about "coding in public": https://x.com/GitMurf/status/2013376160454058472