@mui/internal-bundle-size-checker 1.0.9-canary.30 → 1.0.9-canary.31
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/package.json +2 -2
- package/src/builder.js +3 -3
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.31",
|
|
4
4
|
"description": "Bundle size checker for MUI packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/micromatch": "^4.0.9",
|
|
39
39
|
"@types/yargs": "^17.0.33"
|
|
40
40
|
},
|
|
41
|
-
"gitSha": "
|
|
41
|
+
"gitSha": "2f3a57356b8d7dac3a6970285fa99d43fd6125d2",
|
|
42
42
|
"scripts": {
|
|
43
43
|
"typescript": "tsc -p tsconfig.json",
|
|
44
44
|
"test": "pnpm -w test --project @mui/internal-bundle-size-checker"
|
package/src/builder.js
CHANGED
|
@@ -200,14 +200,14 @@ async function processBundleSizes(output, entryName) {
|
|
|
200
200
|
const manifest = JSON.parse(manifestContent);
|
|
201
201
|
|
|
202
202
|
// Find the main entry point JS file in the manifest
|
|
203
|
-
const mainEntry = manifest[
|
|
203
|
+
const mainEntry = Object.entries(manifest).find(([_, entry]) => entry.name === '_virtual_entry');
|
|
204
204
|
|
|
205
205
|
if (!mainEntry) {
|
|
206
206
|
throw new Error(`No main entry found in manifest for ${entryName}`);
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
// Walk the dependency tree to get all chunks that are part of this entry
|
|
210
|
-
const allChunks = walkDependencyTree(
|
|
210
|
+
const allChunks = walkDependencyTree(mainEntry[0], manifest);
|
|
211
211
|
|
|
212
212
|
// Process each chunk in the dependency tree in parallel
|
|
213
213
|
const chunkPromises = Array.from(allChunks, async (chunkKey) => {
|
|
@@ -224,7 +224,7 @@ async function processBundleSizes(output, entryName) {
|
|
|
224
224
|
const gzipSize = Buffer.byteLength(gzipBuffer);
|
|
225
225
|
|
|
226
226
|
// Use chunk key as the name, or fallback to entry name for main chunk
|
|
227
|
-
const chunkName =
|
|
227
|
+
const chunkName = chunk.name === '_virtual_entry' ? entryName : chunkKey;
|
|
228
228
|
return /** @type {const} */ ([chunkName, { parsed, gzip: gzipSize }]);
|
|
229
229
|
});
|
|
230
230
|
|