Skip to content

Bug: Unused modules are not tree-shaken #423

@devis-velope

Description

@devis-velope

Problem/Opportunity

When building a project it seems that tree-shaking is not working as expected. The entire codebase from the package is being bundled, even though only a subset of the modules is being used in the final build.

A main suspect is the Launch export, it is setting up all the initial configs for the different SDK modules. Also, we found setting sideEffects: false on the package JSON of the SDK reduce the bundle size a bit.

Steps to reproduce

No response

Expected Behavior

Tree-shaking should remove unused modules from the build, resulting in a smaller bundle size containing only the necessary code.

Actual Behavior

The full codebase from the package is included in the final build, which increases the bundle size unnecessarily.

Notes (Optional)

Version of the package: 5.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions