Reputation: 1911
Is there a way to call the UglifyJS2 API in a node script (ie by calling require('uglify-js').minify
) on a string of code such that it removes dead/unreachable code but does not apply any compression
For example:
var foo = 'bar';
if (false) {
foo = 'yo';
}
alert('Foo value found');
alert(foo);
Would become
var foo = 'bar';
alert('Foo value found');
alert(foo);
Upvotes: 7
Views: 1519