Skip to content

Commit dd9e92d

Browse files
authored
[code-infra] Discover exports for bundle size report (#48170)
1 parent 124db37 commit dd9e92d

1 file changed

Lines changed: 5 additions & 33 deletions

File tree

test/bundle-size/bundle-size-checker.config.mjs

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,21 @@
33
*
44
* This file determines which packages and components will have their bundle sizes measured.
55
*/
6-
import path from 'path';
7-
import glob from 'fast-glob';
86
import { defineConfig } from '@mui/internal-bundle-size-checker';
97

10-
const rootDir = path.resolve(import.meta.dirname, '../..');
11-
128
/**
139
* Generates the entrypoints configuration by scanning the project structure.
1410
*/
1511
export default defineConfig(async () => {
16-
// Discover Material UI components
17-
const materialPackagePath = path.join(rootDir, 'packages/mui-material/build');
18-
const materialFiles = await glob(path.join(materialPackagePath, '([A-Z])*/index.js'));
19-
const materialComponents = materialFiles.map((componentPath) => {
20-
const componentName = path.basename(path.dirname(componentPath));
21-
return `@mui/material/${componentName}`;
22-
});
23-
24-
// Discover Lab components
25-
const labPackagePath = path.join(rootDir, 'packages/mui-lab/build');
26-
const labFiles = await glob(path.join(labPackagePath, '([A-Z])*/index.js'));
27-
const labComponents = labFiles.map((componentPath) => {
28-
const componentName = path.basename(path.dirname(componentPath));
29-
return `@mui/lab/${componentName}`;
30-
});
31-
3212
// Return the complete entrypoints configuration
3313
return {
3414
entrypoints: [
35-
'@mui/material',
36-
...materialComponents,
37-
'@mui/lab',
38-
...labComponents,
39-
'@mui/private-theming',
40-
'@mui/system',
41-
'@mui/system/createBox',
42-
'@mui/system/createStyled',
15+
{ id: '@mui/material', expand: true },
4316
'@mui/material/styles#createTheme',
44-
'@mui/system/colorManipulator',
45-
'@mui/lab/useAutocomplete',
46-
'@mui/material/useMediaQuery',
47-
'@mui/material/useScrollTrigger',
48-
'@mui/utils',
17+
{ id: '@mui/lab', expand: true },
18+
'@mui/private-theming',
19+
{ id: '@mui/system', expand: true },
20+
{ id: '@mui/utils', expand: true },
4921
],
5022
upload: !!process.env.CI,
5123
comment: false,

0 commit comments

Comments
 (0)