@farmfe/plugin-react
支持 React Jsx 和 React Refresh
Installation
sh
npm add @farmfe/plugin-reactsh
yarn add @farmfe/plugin-reactsh
pnpm add @farmfe/plugin-reactsh
bun add @farmfe/plugin-reactUsage
导入 @farmfe/plugin-react 并在 farm.config.ts 的 plugins 字段中以工厂函数的形式调用,与 JS 插件用法一致。
ts
import { UserConfig } from '@farmfe/core';
import react from '@farmfe/plugin-react';
const config: UserConfig = {
plugins: [react({ /** options here */ })]
}
Options
请参阅SWC 转换 React 选项。
Farm