跳到主要内容
FarmFarm
2.x(最新)
简体中文
Version: 2.x(最新)
本页目录

@farmfe/plugin-react

支持 React Jsx 和 React Refresh

Installation

sh
npm add @farmfe/plugin-react
sh
yarn add @farmfe/plugin-react
sh
pnpm add @farmfe/plugin-react
sh
bun add @farmfe/plugin-react

Usage

导入 @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 选项。

100%

Drag or pinch to explore. Keyboard: + / − zoom, arrows pan, 0 resets, Esc closes.