mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
chore(dev): tweak frontend-js-size
This commit is contained in:
parent
d0081035fc
commit
079ec865e0
1 changed files with 9 additions and 2 deletions
11
.github/scripts/frontend-js-size.mjs
vendored
11
.github/scripts/frontend-js-size.mjs
vendored
|
|
@ -530,7 +530,7 @@ function renderFrontendBundleReport(before, after) {
|
|||
return lines.join('\n');
|
||||
}
|
||||
|
||||
const visualizerTreemapLimit = 20;
|
||||
const visualizerTreemapLimit = 30;
|
||||
|
||||
function mermaidTreemapLabel(value) {
|
||||
const label = String(value)
|
||||
|
|
@ -543,6 +543,13 @@ function mermaidTreemapLabel(value) {
|
|||
return label === '' ? '(unknown)' : label;
|
||||
}
|
||||
|
||||
function mermaidTreemapModuleLabel(id) {
|
||||
const normalizedId = String(id).replaceAll('\\', '/');
|
||||
const filePath = normalizedId.split(/[?#]/, 1)[0];
|
||||
const fileName = path.posix.basename(filePath);
|
||||
return mermaidTreemapLabel(fileName || normalizedId);
|
||||
}
|
||||
|
||||
function renderVisualizerTreemap(label, report) {
|
||||
const rows = report.hotModules
|
||||
.filter((row) => row.renderedLength > 0)
|
||||
|
|
@ -556,7 +563,7 @@ function renderVisualizerTreemap(label, report) {
|
|||
];
|
||||
|
||||
for (const row of rows) {
|
||||
lines.push(` "${mermaidTreemapLabel(row.id)}": ${Math.round(row.renderedLength)}`);
|
||||
lines.push(` "${mermaidTreemapModuleLabel(row.id)}": ${Math.round(row.renderedLength)}`);
|
||||
}
|
||||
if (otherRendered > 0) {
|
||||
lines.push(` "Other": ${Math.round(otherRendered)}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue