Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,15 @@ function bundleOutputToEsbuildMetafile(
continue;
}

// Read once per module: in Rolldown, `renderedLength` is an uncached getter that
// copies the entire module code across the NAPI bridge on each access.
const { renderedLength } = renderedModule;

for (const [originalInputPath, originalInputInfo] of Object.entries(
originalOutputEntry.inputs,
)) {
const proportion = originalInputInfo.bytesInOutput / totalOriginalBytesInModule;
const newBytesInOutput = Math.floor(renderedModule.renderedLength * proportion);
const newBytesInOutput = Math.floor(renderedLength * proportion);

const existing = newOutputInputs[originalInputPath];
if (existing) {
Expand Down
Loading