Skip to content

Using global in worker adds unnecessary modules to the worker chunk #5

@PeterStaev

Description

@PeterStaev

This is reproducible even with the demo app. If you change the worker to have require("globals") at the top and add global. to onmessage, onerror and postMessage the worker chunk will be 914KB of size, while without those changes the chunk is 6KB of size. This is because the worker chunk does not reuse the vendor chunk and loads in itself all core modules that are needed. This is a really bad design as if you have multiple workers the size will become quite big.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions