File tree 1 file changed +8
-6
lines changed
compiler/packages/react-mcp-server/src/tools
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
import * as babel from '@babel/core' ;
2
2
import puppeteer from 'puppeteer' ;
3
+ // @ts -ignore
4
+ import * as babelPresetTypescript from '@babel/preset-typescript' ;
5
+ // @ts -ignore
6
+ import * as babelPresetEnv from '@babel/preset-env' ;
7
+ // @ts -ignore
8
+ import * as babelPresetReact from '@babel/preset-react' ;
3
9
4
10
type PerformanceResults = {
5
11
renderTime : number ;
@@ -25,15 +31,11 @@ export async function measurePerformance(
25
31
code : string ,
26
32
iterations : number ,
27
33
) : Promise < PerformanceResults > {
28
- const babelOptions = {
34
+ const babelOptions : babel . TransformOptions = {
29
35
filename : 'anonymous.tsx' ,
30
36
configFile : false ,
31
37
babelrc : false ,
32
- presets : [
33
- '@babel/preset-typescript' ,
34
- '@babel/preset-env' ,
35
- '@babel/preset-react' ,
36
- ] ,
38
+ presets : [ babelPresetTypescript , babelPresetEnv , babelPresetReact ] ,
37
39
} ;
38
40
39
41
const parsed = await babel . parseAsync ( code , babelOptions ) ;
You can’t perform that action at this time.
0 commit comments