A Babel 6 plugin that eliminates dead (unreachable) code, including unused variables, unreachable statements, and dead logical operators. It is a fork of babel-plugin-dead-code-elimination with additional fixes and features. Current stable version is v2.2.3, with releases in 2016 (last release 2.2.3). It is specific to Babel 6 and not compatible with Babel 7+. Key differentiators: supports experimental inlining (but warns it may break code), handles hoisted async functions correctly, and properly eliminates repeated var/function declarations.
npm install babel-plugin-transform-dead-code-eliminationVerified import paths — ran on the pinned version, not inferred.
Demonstrates using the plugin to eliminate dead code (unreachable branch and unused variable).
Avoid setting experimentalInlining: true unless you thoroughly test output.
Use @babel/plugin-transform-dead-code-elimination or equivalent for Babel 7.
Upgrade to version 2.2.1 or later.
Use @babel/plugin-transform-dead-code-elimination for Babel 7.
Upgrade to version 2.2.2 or later.
No dependency data recorded yet.