babel-plugin-minify-dead-code

raw JSON →
1.3.2 verified Sat Apr 25 auth: no javascript deprecated

A Babel 6 plugin that removes dead code, such as unreachable branches, unused labels, and constant condition elimination. Version 1.3.2 is the last release and is deprecated. It is part of the babel-minify family but was split into separate plugins: babel-plugin-minify-dead-code-elimination and babel-plugin-minify-guarded-expressions. This plugin is only compatible with Babel 6; for Babel 7, use the replacement plugins. No active development.

error Error: Cannot find module 'babel-plugin-minify-dead-code'
cause Package not installed or npm install failed.
fix
Run npm install babel-plugin-minify-dead-code --save-dev
deprecated Package is deprecated; use babel-plugin-minify-dead-code-elimination and babel-plugin-minify-guarded-expressions instead.
fix Replace with npm install babel-plugin-minify-dead-code-elimination babel-plugin-minify-guarded-expressions and update .babelrc.
breaking Incompatible with Babel 7. Requires Babel 6.
fix Upgrade to Babel 7 and use the replacement plugins.
npm install babel-plugin-minify-dead-code
yarn add babel-plugin-minify-dead-code
pnpm add babel-plugin-minify-dead-code

Add the plugin to Babel 6 configuration to remove dead code.

// .babelrc
{
  "plugins": ["minify-dead-code"]
}