Skip to content

build.chunkSizeWarningLimit options #20121

Open
@mfulton26

Description

@mfulton26

Description

I'd like to specify a build.chunkSizeWarningLimit for most chunks but then specify exceptions for some other chunks. e.g. A chunk for the heic2any package is much larger than most all other chunks. I don't want my main index or other typicaly chunks to grow beyond a threshold but I also don't want to get warnings for known chunks that are large for which I'm accepting the risk.

Suggested solution

Change chunkSizeWarningLimit?: number to something that allows specifying a main limit with overrides by chunk name patterns like chunkSizeWarningLimit?: number | [number, Record<string, number>]

    build: {
      chunkSizeWarningLimit: [500, {
        "heic2any-*": 1500
      }],
    },

This way each chunk whose name matches specified patterns will get the associated warning limit while all other chunks will get a standard limit (in this example 500).

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions