$ npm install babel-plugin-transform-remove-console
This plugin removes all console.*
calls.
In
console.log("foo");
console.error("bar");
Out
npm install babel-plugin-transform-remove-console
.babelrc
(Recommended).babelrc
// without options
{
"plugins": ["transform-remove-console"]
}
// with options
{
"plugins": [ ["transform-remove-console", { "exclude": [ "error", "warn"] }] ]
}
babel --plugins transform-remove-console script.js
require("@babel/core").transform("code", {
plugins: ["transform-remove-console"]
});
exclude
- An array of console methods to exclude from removal.© 2010 - cnpmjs.org x YWFE | Home | YWFE