Open lvqq opened 2 years ago
I guess #1794 should be the same thing where an unused variable name (either from import another file or just var a = side_effect()
) not being removed.
I want to mention #1747 too as all 3 issues here are asking esbuild to do extra work after (or within?) the linking step.
I would like to thumb up this issue as we are also having issues with this. It is even including unused dev dependencies in our production build causing runtime failures because dev dependencies are not installed in our production environment.
For example, the source code as like:
Will be minified to:
The variable
c
is unused but not removed by tree shaking.And output from webpack's or rollup's tree shaking gets
process.cwd()
, it doesn't include the unused var