@@ -21,43 +21,52 @@ const onlyEnableMF = (rslibConfig: RslibConfig) => {
21
21
22
22
const iterations = process . env . CI ? 10 : 50 ;
23
23
24
- describe ( 'benchmark Rslib in examples' , ( ) => {
24
+ const exampleCwds = {
25
+ 'express-plugin' : getCwdByExample ( 'express-plugin' ) ,
26
+ 'react-component-bundle' : getCwdByExample ( 'react-component-bundle' ) ,
27
+ 'react-component-bundle-false' : getCwdByExample ( 'react-component-bundle-false' ) ,
28
+ 'react-component-umd' : getCwdByExample ( 'react-component-bundle-false' ) ,
29
+ 'module-federation/mf-react-component' : getCwdByExample ( 'module-federation/mf-react-component' ) ,
30
+ } ;
31
+
32
+ describe ( 'benchmark Rslib in examples' , async ( ) => {
33
+
25
34
bench (
26
35
'examples/express-plugin' ,
27
36
async ( ) => {
28
- const cwd = getCwdByExample ( 'express-plugin' ) ;
37
+ const cwd = exampleCwds [ 'express-plugin' ] ;
29
38
await rslibBuild ( { cwd, modifyConfig : disableDts } ) ;
30
39
} ,
31
40
{ iterations } ,
32
41
) ;
33
42
bench (
34
43
'examples/react-component-bundle' ,
35
44
async ( ) => {
36
- const cwd = getCwdByExample ( 'react-component-bundle' ) ;
45
+ const cwd = exampleCwds [ 'react-component-bundle' ] ;
37
46
await rslibBuild ( { cwd, modifyConfig : disableDts } ) ;
38
47
} ,
39
48
{ iterations } ,
40
49
) ;
41
50
bench (
42
51
'examples/react-component-bundle-false' ,
43
52
async ( ) => {
44
- const cwd = getCwdByExample ( 'react-component-bundle-false' ) ;
53
+ const cwd = exampleCwds [ 'react-component-bundle-false' ] ;
45
54
await rslibBuild ( { cwd, modifyConfig : disableDts } ) ;
46
55
} ,
47
56
{ iterations } ,
48
57
) ;
49
58
bench (
50
59
'examples/react-component-umd' ,
51
60
async ( ) => {
52
- const cwd = getCwdByExample ( 'react-component-bundle-false' ) ;
61
+ const cwd = exampleCwds [ 'react-component-bundle-false' ] ;
53
62
await rslibBuild ( { cwd, modifyConfig : disableDts } ) ;
54
63
} ,
55
64
{ iterations } ,
56
65
) ;
57
66
bench (
58
67
'examples/module-federation/mf-react-component' ,
59
68
async ( ) => {
60
- const cwd = getCwdByExample ( 'module-federation/mf-react-component' ) ;
69
+ const cwd = exampleCwds [ 'module-federation/mf-react-component' ] ;
61
70
await rslibBuild ( { cwd, modifyConfig : onlyEnableMF } ) ;
62
71
} ,
63
72
{ iterations } ,
0 commit comments