@mui/internal-bundle-size-checker 1.0.9-canary.27 → 1.0.9-canary.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +2 -3
- package/src/builder.js +6 -1
- package/src/cli.js +6 -0
- package/src/configLoader.js +3 -0
- package/src/types.d.ts +1 -0
package/README.md
CHANGED
|
@@ -19,8 +19,12 @@ bundle-size-checker [options]
|
|
|
19
19
|
|
|
20
20
|
Options:
|
|
21
21
|
|
|
22
|
-
- `--analyze`: Creates a
|
|
22
|
+
- `--analyze`: Creates a report for each bundle (using rollup-plugin-visualizer)
|
|
23
|
+
- `--debug`: Build with readable output (no name mangling or whitespace collapse, but still tree-shake)
|
|
24
|
+
- `--verbose`: Show more detailed information during compilation
|
|
23
25
|
- `--output`, `-o`: Path to output the size snapshot JSON file
|
|
26
|
+
- `--filter`, `-F`: Filter entry points by glob pattern(s) applied to their IDs
|
|
27
|
+
- `--concurrency`, `-c`: Number of workers to use for parallel processing
|
|
24
28
|
|
|
25
29
|
### Configuration
|
|
26
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-bundle-size-checker",
|
|
3
|
-
"version": "1.0.9-canary.
|
|
3
|
+
"version": "1.0.9-canary.29",
|
|
4
4
|
"description": "Bundle size checker for MUI packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"chalk": "^5.5.0",
|
|
27
27
|
"env-ci": "^11.1.1",
|
|
28
28
|
"execa": "^9.6.0",
|
|
29
|
-
"fast-glob": "^3.3.3",
|
|
30
29
|
"git-url-parse": "^16.1.0",
|
|
31
30
|
"micromatch": "^4.0.8",
|
|
32
31
|
"piscina": "^5.1.3",
|
|
@@ -39,7 +38,7 @@
|
|
|
39
38
|
"@types/micromatch": "^4.0.9",
|
|
40
39
|
"@types/yargs": "^17.0.33"
|
|
41
40
|
},
|
|
42
|
-
"gitSha": "
|
|
41
|
+
"gitSha": "79ad58df711429581fc497ec6344e9c16c9f7de5",
|
|
43
42
|
"scripts": {
|
|
44
43
|
"typescript": "tsc -p tsconfig.json",
|
|
45
44
|
"test": "pnpm -w test --project @mui/internal-bundle-size-checker"
|
package/src/builder.js
CHANGED
|
@@ -70,7 +70,7 @@ async function createViteConfig(entry, args) {
|
|
|
70
70
|
|
|
71
71
|
build: {
|
|
72
72
|
write: true,
|
|
73
|
-
minify: true,
|
|
73
|
+
minify: args.debug ? 'esbuild' : true,
|
|
74
74
|
outDir,
|
|
75
75
|
emptyOutDir: true,
|
|
76
76
|
rollupOptions: {
|
|
@@ -100,6 +100,11 @@ async function createViteConfig(entry, args) {
|
|
|
100
100
|
|
|
101
101
|
esbuild: {
|
|
102
102
|
legalComments: 'none',
|
|
103
|
+
...(args.debug && {
|
|
104
|
+
minifyIdentifiers: false,
|
|
105
|
+
minifyWhitespace: false,
|
|
106
|
+
minifySyntax: true, // This enables tree-shaking and other safe optimizations
|
|
107
|
+
}),
|
|
103
108
|
},
|
|
104
109
|
|
|
105
110
|
define: {
|
package/src/cli.js
CHANGED
|
@@ -173,6 +173,12 @@ yargs(process.argv.slice(2))
|
|
|
173
173
|
describe: 'Show more detailed information during compilation.',
|
|
174
174
|
type: 'boolean',
|
|
175
175
|
})
|
|
176
|
+
.option('debug', {
|
|
177
|
+
default: false,
|
|
178
|
+
describe:
|
|
179
|
+
'Build with readable output (no name mangling or whitespace collapse, but still tree-shake).',
|
|
180
|
+
type: 'boolean',
|
|
181
|
+
})
|
|
176
182
|
.option('output', {
|
|
177
183
|
alias: 'o',
|
|
178
184
|
describe:
|
package/src/configLoader.js
CHANGED
|
@@ -29,6 +29,9 @@ async function loadConfigFile(configPath) {
|
|
|
29
29
|
resolvedConfig = await config;
|
|
30
30
|
} else if (typeof config === 'function') {
|
|
31
31
|
resolvedConfig = await config();
|
|
32
|
+
} else {
|
|
33
|
+
// Handle plain config objects
|
|
34
|
+
resolvedConfig = config;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
return resolvedConfig;
|