Skip to content

Commit

Permalink
feat(plugin-react): adding jsxPure option (#7088)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpapini authored Mar 25, 2022
1 parent 77dc1a1 commit d451435
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export interface Options {
* @default "react"
*/
jsxImportSource?: string
/**
* Set this to `true` to annotate the JSX factory with `\/* @__PURE__ *\/`.
* This option is ignored when `jsxRuntime` is not `"automatic"`.
* @default true
*/
jsxPure?: boolean

/**
* Babel configuration applied in both dev and prod.
Expand Down Expand Up @@ -195,7 +201,8 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
),
{
runtime: 'automatic',
importSource: opts.jsxImportSource
importSource: opts.jsxImportSource,
pure: opts.jsxPure !== false
}
])

Expand Down

0 comments on commit d451435

Please sign in to comment.