WXT Web Extension Framework

0.20.25 · active · verified Sun Apr 19

WXT is a next-generation web extension framework designed for building browser extensions across all major browsers (Chrome, Firefox, Edge, etc.) supporting both Manifest V2 and Manifest V3. It leverages Vite for fast development with Hot Module Replacement (HMR) and rapid reloads. The current stable version is `0.20.25`. WXT follows a frequent release cadence, often releasing multiple patch versions within weeks, indicating active development and responsiveness to bug fixes and minor enhancements. Key differentiators include its file-based entrypoints, comprehensive TypeScript support, auto-imports, a flexible module system for code reuse, and framework agnosticism, allowing integration with popular UI libraries like Vue, React, and Svelte via dedicated modules. It also provides automated publishing capabilities and bundle analysis.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic `wxt.config.ts` file, defining entrypoints, manifest permissions, and host permissions for a typical web extension project. It illustrates the primary configuration method for WXT.

import { defineConfig } from 'wxt';

export default defineConfig({
  srcDir: 'src',
  publicDir: 'public',
  entrypoints: {
    background: 'src/background.ts',
    'content-scripts/inject': 'src/content-scripts/inject.ts',
    popup: 'src/popup/index.html',
    options: 'src/options/index.html',
  },
  manifest: {
    host_permissions: ['*://*.google.com/*', '*://*.bing.com/*'],
    permissions: ['storage', 'unlimitedStorage'],
    name: 'My Awesome Extension',
    version: '1.0.0',
    description: 'A quickstart web extension built with WXT.',
  },
  modules: {
    // Example: add the React module if using React
    // react: true,
  },
});

view raw JSON →