File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -27,19 +27,31 @@ export const babelTransform: BuildStep = async (options) => {
27
27
] ,
28
28
plugins :
29
29
(
30
- // compiler will insert `"import"` statements, so it's not CJS compatible
31
- options . type === "esm" &&
32
30
// apply the compiler only to the react hooks, not test helper components etc.
33
31
relativeSourcePath . match ( / r e a c t \/ h o o k s / )
34
32
) ?
35
- [
33
+ // compiler will insert `"import"` statements, so it's not CJS compatible
34
+ options . type === "esm" ?
36
35
[
37
- "babel-plugin-react-compiler" ,
38
- {
39
- target : "17" ,
40
- } ,
41
- ] ,
42
- ]
36
+ [
37
+ "babel-plugin-react-compiler" ,
38
+ {
39
+ target : "17" ,
40
+ } ,
41
+ ] ,
42
+ ]
43
+ : [
44
+ [
45
+ "babel-plugin-react-compiler" ,
46
+ {
47
+ target : "17" ,
48
+ } ,
49
+ ] ,
50
+ [
51
+ "@babel/plugin-transform-modules-commonjs" ,
52
+ { importInterop : "none" } ,
53
+ ] ,
54
+ ]
43
55
: [ ] ,
44
56
} ) ;
45
57
return { ast : result . ast ! , map : result . map } ;
You can’t perform that action at this time.
0 commit comments