|
3 | 3 | * |
4 | 4 | * This file determines which packages and components will have their bundle sizes measured. |
5 | 5 | */ |
6 | | -import path from 'path'; |
7 | | -import glob from 'fast-glob'; |
8 | 6 | import { defineConfig } from '@mui/internal-bundle-size-checker'; |
9 | 7 |
|
10 | | -const rootDir = path.resolve(import.meta.dirname, '../..'); |
11 | | - |
12 | 8 | /** |
13 | 9 | * Generates the entrypoints configuration by scanning the project structure. |
14 | 10 | */ |
15 | 11 | 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 | | - |
32 | 12 | // Return the complete entrypoints configuration |
33 | 13 | return { |
34 | 14 | 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 }, |
43 | 16 | '@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 }, |
49 | 21 | ], |
50 | 22 | upload: !!process.env.CI, |
51 | 23 | comment: false, |
|
0 commit comments