Skip to content

Commit

Permalink
refactor: shorten react import regex pattern (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleShit committed Nov 4, 2023
1 parent b255776 commit 9956fb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
// - import * as React from 'react';
// - import React from 'react';
// - import React, {useEffect} from 'react';
const importReactRE = /(?:^|\s)import\s+(?:\*\s+as\s+)?React(?:,|\s+)/
const importReactRE = /\bimport\s+(?:\*\s+as\s+)?React\b/

const viteBabel: Plugin = {
name: 'vite:react-babel',
Expand Down

0 comments on commit 9956fb5

Please sign in to comment.