Skip to content

Commit 314987e

Browse files
committed
fix: return Plugin[] instead of PluginOption[]
1 parent 079feaf commit 314987e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/plugin-react-oxc/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { dirname, join } from 'node:path'
22
import { fileURLToPath } from 'node:url'
33
import { readFileSync } from 'node:fs'
4-
import type { BuildOptions, Plugin, PluginOption } from 'vite'
4+
import type { BuildOptions, Plugin } from 'vite'
55
import {
66
addRefreshWrapper,
77
avoidSourceMapOption,
@@ -30,7 +30,7 @@ export interface Options {
3030

3131
const defaultIncludeRE = /\.[tj]sx?(?:$|\?)/
3232

33-
export default function viteReact(opts: Options = {}): PluginOption[] {
33+
export default function viteReact(opts: Options = {}): Plugin[] {
3434
const include = opts.include ?? defaultIncludeRE
3535
const exclude = [
3636
...(Array.isArray(opts.exclude)

packages/plugin-react-swc/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
type Options as SWCOptions,
1212
transform,
1313
} from '@swc/core'
14-
import type { PluginOption } from 'vite'
14+
import type { Plugin } from 'vite'
1515
import {
1616
addRefreshWrapper,
1717
getPreambleCode,
@@ -83,7 +83,7 @@ type Options = {
8383
disableOxcRecommendation?: boolean
8484
}
8585

86-
const react = (_options?: Options): PluginOption[] => {
86+
const react = (_options?: Options): Plugin[] => {
8787
let hmrDisabled = false
8888
const options = {
8989
jsxImportSource: _options?.jsxImportSource ?? 'react',

packages/plugin-react/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type * as babelCore from '@babel/core'
55
import type { ParserOptions, TransformOptions } from '@babel/core'
66
import { createFilter } from 'vite'
77
import * as vite from 'vite'
8-
import type { Plugin, PluginOption, ResolvedConfig } from 'vite'
8+
import type { Plugin, ResolvedConfig } from 'vite'
99
import {
1010
addRefreshWrapper,
1111
getPreambleCode,
@@ -109,7 +109,7 @@ export type ViteReactPluginApi = {
109109
const defaultIncludeRE = /\.[tj]sx?$/
110110
const tsRE = /\.tsx?$/
111111

112-
export default function viteReact(opts: Options = {}): PluginOption[] {
112+
export default function viteReact(opts: Options = {}): Plugin[] {
113113
const include = opts.include ?? defaultIncludeRE
114114
const exclude = opts.exclude
115115
const filter = createFilter(include, exclude)

0 commit comments

Comments
 (0)