File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,19 @@ module.exports = {
8080
8181 // This is only for React DevTools tests with React 16.x
8282 // `react/jsx-dev-runtime` and `react/jsx-runtime` are included in the package starting from v17
83- if ( semver . gte ( ReactVersionTestingAgainst , '17.0.0' ) ) {
83+ // Technically 16.14 and 15.7 have the new runtime but we're not testing those versions.
84+ if (
85+ semver . gte ( ReactVersionTestingAgainst , '15.0.0' ) &&
86+ semver . lt ( ReactVersionTestingAgainst , '17.0.0' )
87+ ) {
88+ plugins . push (
89+ [
90+ require . resolve ( '@babel/plugin-transform-react-jsx' ) ,
91+ { runtime : 'classic' } ,
92+ ] ,
93+ require . resolve ( '@babel/plugin-transform-react-jsx-source' )
94+ ) ;
95+ } else {
8496 plugins . push ( [
8597 process . env . NODE_ENV === 'development'
8698 ? require . resolve ( '@babel/plugin-transform-react-jsx-development' )
@@ -89,14 +101,6 @@ module.exports = {
89101 // would be React.createElement.
90102 { runtime : 'automatic' } ,
91103 ] ) ;
92- } else {
93- plugins . push (
94- [
95- require . resolve ( '@babel/plugin-transform-react-jsx' ) ,
96- { runtime : 'classic' } ,
97- ] ,
98- require . resolve ( '@babel/plugin-transform-react-jsx-source' )
99- ) ;
100104 }
101105
102106 plugins . push ( pathToTransformLazyJSXImport ) ;
You can’t perform that action at this time.
0 commit comments