Skip to content

fix: json module size#12189

Merged
LingyuCoder merged 2 commits intomainfrom
fix/json-module-size
Nov 13, 2025
Merged

fix: json module size#12189
LingyuCoder merged 2 commits intomainfrom
fix/json-module-size

Conversation

@LingyuCoder
Copy link
Copy Markdown
Contributor

Summary

fix #12173

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 13, 2025 09:56
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 13, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 13, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit c8a6ffb
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6915ab3814ce58000894f253

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the JSON module size calculation to report the actual size of the JSON data instead of the generated module source code with boilerplate.

  • Changes the size() method to calculate size based on stringified JSON data from build_info rather than the full generated module source
  • Updates the size calculation to use json_data field directly, providing more accurate module size reporting

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/rspack_plugin_json/src/lib.rs Modified the size() method to calculate module size from the parsed JSON data instead of the generated source code
tests/rspack-test/statsOutputCases/ignore-warnings/snapshots/stats.txt Updated test snapshot to reflect the corrected module size (797 → 784 bytes)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing c8a6ffb to fix: missing type of http proxy middleware options (#12188) by harpsealjs

❌ Size increased by 768bytes from 47.45MB to 47.45MB (⬆️0.00%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #12189 will not alter performance

Comparing fix/json-module-size (c8a6ffb) with main (b4c08a1)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder enabled auto-merge (squash) November 13, 2025 10:22
@LingyuCoder LingyuCoder merged commit b943377 into main Nov 13, 2025
53 checks passed
@LingyuCoder LingyuCoder deleted the fix/json-module-size branch November 13, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Rspack stats reports incorrect chunk information for chunks with dynamically imported JSON files

3 participants