Skip to content

[Feature request] Add flag for optionally disabling tree-shaking #458

@mattem

Description

@mattem

Feature request

A command line flag to opt-out of tree-shaking (or opt-in to tree-shaking, that defaults true). An alternative could also to only enable tree-shaking if the --minify option is also present.

Motivation

Attempting to use esbuild as a replacement for concat_js / Webpack when using Karma, the test runner for Angular.
When Angular compiles templates to TS, it marks the generated metadata functions as pure as these aren't needed in production builds, however in some situations they are needed during tests.

Using esbuild to generate a testing bundle will currently remove the function calls that are marked as pure (rightly so), but for this use case they are needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions