Skip to content

Commit

Permalink
fix(plugin-react): set this-is-undefined-in-esm to silent if classi…
Browse files Browse the repository at this point in the history
…c runtime (#8674)
  • Loading branch information
sapphi-red committed Jun 20, 2022
1 parent afe88ff commit f0aecba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-react/package.json
Expand Up @@ -47,7 +47,7 @@
"react-refresh": "^0.13.0"
},
"peerDependencies": {
"vite": "^3.0.0-alpha"
"vite": "^3.0.0-alpha.11"
},
"devDependencies": {
"vite": "workspace:*"
Expand Down
11 changes: 11 additions & 0 deletions packages/plugin-react/src/index.ts
Expand Up @@ -117,6 +117,17 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
const viteBabel: Plugin = {
name: 'vite:react-babel',
enforce: 'pre',
config() {
if (opts.jsxRuntime === 'classic') {
return {
esbuild: {
logOverride: {
'this-is-undefined-in-esm': 'silent'
}
}
}
}
},
configResolved(config) {
base = config.base
projectRoot = config.root
Expand Down

0 comments on commit f0aecba

Please sign in to comment.