We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b255776 commit 9956fb5Copy full SHA for 9956fb5
packages/plugin-react/src/index.ts
@@ -113,7 +113,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
113
// - import * as React from 'react';
114
// - import React from 'react';
115
// - import React, {useEffect} from 'react';
116
- const importReactRE = /(?:^|\s)import\s+(?:\*\s+as\s+)?React(?:,|\s+)/
+ const importReactRE = /\bimport\s+(?:\*\s+as\s+)?React\b/
117
118
const viteBabel: Plugin = {
119
name: 'vite:react-babel',
0 commit comments