Skip to content

Commit 07881a4

Browse files
committed
chore(infra/bench): remove getCwdByExample stack in bench
1 parent 9bbd04b commit 07881a4

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/benchmark/index.bench.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,52 @@ const onlyEnableMF = (rslibConfig: RslibConfig) => {
2121

2222
const iterations = process.env.CI ? 10 : 50;
2323

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+
2534
bench(
2635
'examples/express-plugin',
2736
async () => {
28-
const cwd = getCwdByExample('express-plugin');
37+
const cwd = exampleCwds['express-plugin'];
2938
await rslibBuild({ cwd, modifyConfig: disableDts });
3039
},
3140
{ iterations },
3241
);
3342
bench(
3443
'examples/react-component-bundle',
3544
async () => {
36-
const cwd = getCwdByExample('react-component-bundle');
45+
const cwd = exampleCwds['react-component-bundle'];
3746
await rslibBuild({ cwd, modifyConfig: disableDts });
3847
},
3948
{ iterations },
4049
);
4150
bench(
4251
'examples/react-component-bundle-false',
4352
async () => {
44-
const cwd = getCwdByExample('react-component-bundle-false');
53+
const cwd = exampleCwds['react-component-bundle-false'];
4554
await rslibBuild({ cwd, modifyConfig: disableDts });
4655
},
4756
{ iterations },
4857
);
4958
bench(
5059
'examples/react-component-umd',
5160
async () => {
52-
const cwd = getCwdByExample('react-component-bundle-false');
61+
const cwd = exampleCwds['react-component-bundle-false'];
5362
await rslibBuild({ cwd, modifyConfig: disableDts });
5463
},
5564
{ iterations },
5665
);
5766
bench(
5867
'examples/module-federation/mf-react-component',
5968
async () => {
60-
const cwd = getCwdByExample('module-federation/mf-react-component');
69+
const cwd = exampleCwds['module-federation/mf-react-component'];
6170
await rslibBuild({ cwd, modifyConfig: onlyEnableMF });
6271
},
6372
{ iterations },

0 commit comments

Comments
 (0)