How to use the minification.removeConsole transformer.
Remove all calls to console.*
functions.
require("babel").transform("code", { optional: ["minification.removeConsole"] });
$ babel --optional minification.removeConsole script.js
In
console.log("foo");
console.error("bar");
console.trace();
console.assert(foo());
Out