A babel plugin that removes certain function calls from your code. For example:
// input
console.log('hello')
Logger.debug('123')
Logger(123)
Logger.log('123')
// output
console.log('hello')
# npm
npm i babel-plugin-transform-remove-funcall
# yarn
yarn add babel-plugin-transform-remove-funcall
# pnpm
pnpm i babel-plugin-transform-remove-funcall
// .babelrc.js or babel.config.js
module.exports = {
plugins: [
['transform-remove-funcall', { callChains: ['Logger', 'debug', 'log'] }]
// ...other plugins
],
}
// example:
// input
console.log('hello')
Logger.debug('123')
Logger.inst.debug('123')
Logger(123)
Logger.log('123')
// output
console.log('hello')
MIT License © 2024-PRESENT Jianxing Xu