Skip to content

If webpack stats object gets large enough, JSON.stringify crashes #109

Open
@maclockard

Description

@maclockard

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Code Sandbox link

No response

Bug report

The same bug that webpack/webpack-cli#2190 fixes. The issue here is if webpack stats object is large enough you can no longer just call JSON.stringify on it, otherwise you get errors along the lines of RangeError: Invalid string length.

The fix here is to stream the JSON serialization rather than doing it at once. Fixing this might be tricky without making a breaking change to the plugin API since I'm not sure how it can be compatible with the current opts.transform

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions