Registry /
devops / babel-plugin-minify-dead-code-elimination-while-loop-fixed
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ module.exports = require('babel-plugin-minify-dead-code-elimination-while-loop-fixed')
✗ import plugin from 'babel-plugin-minify-dead-code-elimination-while-loop-fixed'
This package is a CommonJS plugin. Use require() for Node.js/Babel config. ESM import is not supported.
function
✓ {
"plugins": ["minify-dead-code-elimination-while-loop-fixed"]
}
✗ {
"plugins": ["babel-plugin-minify-dead-code-elimination-while-loop-fixed"]
}
In .babelrc or babel.config.js, omit the 'babel-plugin-' prefix. Use the short name.
options
✓ {
"plugins": [["minify-dead-code-elimination-while-loop-fixed", { "keepFnName": true }]]
}
✗ {
"plugins": ["minify-dead-code-elimination-while-loop-fixed", { "keepFnName": true }]
}
When passing options, the plugin must be specified as an array inside another array. Missing the inner array will cause options to be ignored.
Shows how to install and configure the plugin in .babelrc, and the effect of dead code elimination.
// Install the plugin
// npm install babel-plugin-minify-dead-code-elimination-while-loop-fixed
// .babelrc example
{
"presets": ["@babel/preset-env"],
"plugins": ["minify-dead-code-elimination-while-loop-fixed"]
}
// Input code
function foo() { var x = 1; }
function bar() { var x = f(); }
function baz() {
var x = 1;
console.log(x);
function unused() { return 5; }
}
// After transformation (output)
// function foo() {}
// function bar() { f(); }
// function baz() {
// console.log(1);
// }
Errors
Common errors & fixes
Error: Cannot find module 'babel-plugin-minify-dead-code-elimination-while-loop-fixed'
Plugin not installed or typo in module name.
fixRun npm install babel-plugin-minify-dead-code-elimination-while-loop-fixed --save-dev
TypeError: The plugin "minify-dead-code-elimination-while-loop-fixed" didn't return a function.
Using ESM import instead of require(). The plugin exports via module.exports.
fixUse require() in Node.js or configure Babel with the string plugin name in .babelrc.
Error: .babelrc: plugins[0] must be a string or an array of [string, options]
Options not nested correctly in an array.
fixUse [["minify-dead-code-elimination-while-loop-fixed", { ... }]] syntax. Audit
Dependencies
babel-corerequiredRequired for plugin to be loaded and used in Babel transformations.