Open KamalAman opened 5 years ago
I ran into the same problem.
There are two plugins involved here. simplify
is the one that rewrites the while
to a for
and mangle
then incorrectly renames the identifier.
Personally I turned off simplify
:
["minify", {
"builtIns": false,
"simplify": false
}]
Alternatively, you could turn off mangle
:
["minify", {
"builtIns": false,
"mangle": false
}]
You can target just a single identifier, though that seems much too fragile to me:
["minify", {
"builtIns": false,
"mangle": {
"exclude": {"arr": true}
}
}]
Describe the bug
arr
is undefined in the minified codeTo Reproduce
Actual Output
Expected Output
Configuration
"@babel/cli": "7.6.4", "@babel/core": "7.6.4", "babel-preset-minify": "0.5.1", babelrc:
Switching the while loop to a for loop fixes the symptoms of the problem.