mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Replace generic bundle names with arch names in bundle-visualizer (#10021)
This commit is contained in:
committed by
Ben Newman
parent
f42629ce5e
commit
fbea42ca7c
@@ -1,5 +1,5 @@
|
||||
Package.describe({
|
||||
version: '1.2.0',
|
||||
version: '1.2.1',
|
||||
summary: 'Meteor bundle analysis and visualization.',
|
||||
documentation: 'README.md',
|
||||
});
|
||||
|
||||
@@ -52,17 +52,18 @@ function getStatBundles() {
|
||||
Object.keys(staticFilesByArch).forEach(arch => {
|
||||
const staticFiles = staticFilesByArch[arch];
|
||||
Object.keys(staticFiles).forEach(path => {
|
||||
files.push(staticFiles[path]);
|
||||
files.push({ ...staticFiles[path], arch });
|
||||
});
|
||||
});
|
||||
} else if (staticFiles) {
|
||||
Object.keys(staticFiles).forEach(path => {
|
||||
files.push(staticFiles[path]);
|
||||
files.push({ ...staticFiles[path], arch: 'bundle' });
|
||||
});
|
||||
}
|
||||
|
||||
return files.filter(statFileFilter).map(file => ({
|
||||
name: file.hash,
|
||||
arch: file.arch,
|
||||
stats: readOrNull(file.absolutePath),
|
||||
}));
|
||||
}
|
||||
@@ -152,10 +153,7 @@ function statsMiddleware(request, response) {
|
||||
sendJSON({
|
||||
name: "main",
|
||||
children: statBundles.map((statBundle, index, array) => ({
|
||||
// TODO: If multiple bundles, could
|
||||
// show abbr. bundle names with:
|
||||
// `...${bundle.name.substr(-3)}`,
|
||||
name: "bundle" + (array.length > 1 ? ` (${index + 1})` : ""),
|
||||
name: statBundle.arch,
|
||||
type: typeBundle,
|
||||
children: d3TreeFromStats(statBundle.stats),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user