Skip to content

Commit 104bdb5

Browse files
authored
feat(plugin-react): ensure overrides array exists before api.reactBabel hooks are called (#6750)
1 parent ff37c03 commit 104bdb5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/plugin-react/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export type BabelOptions = Omit<
6060
export interface ReactBabelOptions extends BabelOptions {
6161
plugins: Extract<BabelOptions['plugins'], any[]>
6262
presets: Extract<BabelOptions['presets'], any[]>
63+
overrides: Extract<BabelOptions['overrides'], any[]>
6364
parserOpts: ParserOptions & {
6465
plugins: Extract<ParserOptions['plugins'], any[]>
6566
}
@@ -95,6 +96,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
9596

9697
babelOptions.plugins ||= []
9798
babelOptions.presets ||= []
99+
babelOptions.overrides ||= []
98100
babelOptions.parserOpts ||= {} as any
99101
babelOptions.parserOpts.plugins ||= opts.parserPlugins || []
100102

0 commit comments

Comments
 (0)