@wxt-dev/module-react
v1.1.1
Published
WXT module to enable React support
Downloads
7,463
Readme
@wxt-dev/module-react
Enables the use of React in your web extension, in HTML pages and content scripts.
This plugin makes a few changes:
- Adds
@vitejs/plugin-react
to vite - Adds the
react
preset to auto-imports
Usage
pnpm i react react-dom
pnpm i -D @wxt-dev/module-react
Then add the module to your config:
// wxt.config.ts
export default defineConfig({
// Required
modules: ['@wxt-dev/module-react'],
// Optional: Pass options to the module:
react: {
vite: {
// ...
},
},
});