fix: shard unnamed modules into __unmapped/NNxxx to avoid GitHub 1000-file truncation

This commit is contained in:
lvwmwm 2026-08-27 12:47:14 -03:00
parent 3067006c7b
commit e6e9c1ada1

View file

@ -56,8 +56,10 @@ export default async function code(progress: Progress, _code: string[]) {
if (id !== undefined) { if (id !== undefined) {
const sourcePath = modulePaths.get(id); const sourcePath = modulePaths.get(id);
if (sourcePath) return sanitizePath(sourcePath); if (sourcePath) return sanitizePath(sourcePath);
const bucket = Math.floor(id / 1000);
return `__unmapped/${String(bucket).padStart(2, "0")}xxx/${relativePath}`;
} }
return relativePath; return `__unmapped/${relativePath}`;
} }
const files = new Map<string, number>(); const files = new Map<string, number>();