Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.
This repository was archived by the owner on Feb 1, 2021. It is now read-only.

413 on initial assets upload #9

Open
@tstirrat15

Description

@tstirrat15

I'm trying to get bundle-analyzer working on our app. We've got a bundle that includes some ~600 image assets (300 svgs + their gzipped counterparts). When it goes to do the initial asset array upload, that endpoint 413s because the assets object is larger than the 100kb limit that's defaulted to in the middleware for that endpoint. I was able to hack around it by adding an excludeAssets filter to the webpack plugin code:

      const stats = hookCompiler.getStats().toJson({
        maxModules: Infinity,
        source: false,
        excludeAssets: [/.svg/, /.jpg/],
      });

So it seems there would be two ways to go about fixing this:

  • Bump the body size limit (would prevent this error from happening by default)
  • Add logic to the webpack plugin to allow the user to exclude assets (perhaps could go into the configuration?)

I noted that while there did seem to be filter logic in the configuration file, that filter logic wasn't used in the webpack plugin. Would that be a way to approach it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions