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.
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--minifyoption 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.