Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/plugin-react-oxc/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { readFileSync } from 'node:fs'
import type { BuildOptions, Plugin, PluginOption } from 'vite'
import type { BuildOptions, Plugin } from 'vite'
import {
addRefreshWrapper,
avoidSourceMapOption,
Expand Down Expand Up @@ -30,7 +30,7 @@ export interface Options {

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

export default function viteReact(opts: Options = {}): PluginOption[] {
export default function viteReact(opts: Options = {}): Plugin[] {
const include = opts.include ?? defaultIncludeRE
const exclude = [
...(Array.isArray(opts.exclude)
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-react-swc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
type Options as SWCOptions,
transform,
} from '@swc/core'
import type { PluginOption } from 'vite'
import type { Plugin } from 'vite'
import {
addRefreshWrapper,
getPreambleCode,
Expand Down Expand Up @@ -83,7 +83,7 @@ type Options = {
disableOxcRecommendation?: boolean
}

const react = (_options?: Options): PluginOption[] => {
const react = (_options?: Options): Plugin[] => {
let hmrDisabled = false
const options = {
jsxImportSource: _options?.jsxImportSource ?? 'react',
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type * as babelCore from '@babel/core'
import type { ParserOptions, TransformOptions } from '@babel/core'
import { createFilter } from 'vite'
import * as vite from 'vite'
import type { Plugin, PluginOption, ResolvedConfig } from 'vite'
import type { Plugin, ResolvedConfig } from 'vite'
import {
addRefreshWrapper,
getPreambleCode,
Expand Down Expand Up @@ -109,7 +109,7 @@ export type ViteReactPluginApi = {
const defaultIncludeRE = /\.[tj]sx?$/
const tsRE = /\.tsx?$/

export default function viteReact(opts: Options = {}): PluginOption[] {
export default function viteReact(opts: Options = {}): Plugin[] {
const include = opts.include ?? defaultIncludeRE
const exclude = opts.exclude
const filter = createFilter(include, exclude)
Expand Down
Loading