Skip to content
Open
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 @@ -180,4 +180,20 @@ export function patchNativeModuleSources(
});
}
}

// Handle JSON module sizes from Rspack native plugin
const jsonModuleSizes = rawModuleSourcesPatch.json_module_sizes as
| Array<{ identifier: string; size: number }>
| undefined;
if (jsonModuleSizes && jsonModuleSizes.length > 0) {
for (const jsonModuleSize of jsonModuleSizes) {
const module = mg.getModuleByWebpackId(jsonModuleSize.identifier);
if (module) {
// Set parsedSize for JSON modules from Rspack's tree-shaken size
module.setSize({
parsedSize: jsonModuleSize.size,
});
Comment on lines +188 to +195
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new JSON module parsedSize handling in patchNativeModuleSources is not covered by tests, whereas related behavior (e.g. JSON parsedSize from stats in graph/src/transform/module-graph/transform.ts and Rspack native graph transforms in core/tests/build/utils/rspack-transform.test.ts) is tested. To avoid regressions and ensure the Rspack-native path matches the expected JSON size semantics, please add tests that exercise json_module_sizes (including cases like multiple JSON modules and absence of entries).

Copilot uses AI. Check for mistakes.
}
}
}
}
Loading