-
Fix
export {}
statements with--tree-shaking=true
(#1628)The new
--tree-shaking=true
option allows you to force-enable tree shaking in cases where it wasn't previously possible. One such case is when bundling is disabled and there is no output format configured, in which case esbuild just preserves the format of whatever format the input code is in. Enabling tree shaking in this context caused a bug whereexport {}
statements were stripped. This release fixes the bug soexport {}
statements should now be preserved when you pass--tree-shaking=true
. This bug only affected this new functionality and didn't affect existing scenarios.