This plugin removes all console.*
calls.
In
console.log("foo");
console.error("bar");
Out
In
console.log("foo");
console.error("bar");
Out
console.error("bar"); // set options to ignore error
npm install babel-plugin-transform-remove-console-enhance
.babelrc
{
"plugins": ["transform-remove-console-enhance"]
}
or
{
"plugins": [
["transform-remove-console-enhance", {
"exclude": ["error"]
}]
]
}
options
can be object.
{
"exclude": ["error"]
}
babel --plugins transform-remove-console-enhance script.js
require("babel-core").transform("code", {
plugins: ["transform-remove-console-enhance"]
});