WXT module to enable React support
npm install @wxt-dev/module-react@wxt-dev/module-reactEnables the use of React in your web extension, in HTML pages and content scripts.
This plugin makes a few changes:
1. Adds @vitejs/plugin-react to vite
2. Adds the react preset to auto-imports
``sh`
pnpm i react react-dom
pnpm i -D @wxt-dev/module-react
Then add the module to your config:
`ts
// wxt.config.ts
export default defineConfig({
// Required
modules: ['@wxt-dev/module-react'],
// Optional: Pass options to the module:
react: {
vite: {
// ...
},
},
});
``