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.
npm install wxtVerified import paths — ran on the pinned version, not inferred.
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.
Upgrade your Node.js runtime to `20.12.0` or higher, or use Bun `1.2.0` or higher.
Ensure you are using `wxt@0.20.19` or newer for Vite 8 compatibility. Update WXT-specific modules (e.g., `@wxt-dev/module-react`, `@wxt-dev/module-svelte`) to their latest versions to support newer Vite plugin versions.
Install `eslint` as a dev dependency (`npm install -D eslint@'^8.57.0 || ^9.0.0 || ^10.0.0'`) ensuring it matches the specified peer dependency range.
Consult the official WXT documentation on MV2/MV3 compatibility and browser-specific API changes. Test extensions thoroughly across target browsers and manifest versions.
Update to `wxt@0.20.25` or newer to ensure consistent dev server port behavior on reload. Consider using `dev.server.strictPort` for explicit port control if issues persist.
Upgrade Node.js to version `20.12.0` or newer (e.g., using `nvm install 20` and `nvm use 20`). Alternatively, use Bun version `1.2.0` or higher.
Install `eslint` with `npm install -D eslint@'^8.57.0 || ^9.0.0 || ^10.0.0'` to match the expected peer dependency range.
Ensure `vite` is installed as a `devDependency` (`npm install -D vite`) and that WXT is updated to a version compatible with your Vite installation (e.g., `wxt@0.20.19` for Vite 8 support).