babel-plugin-transform-remove-funcall
v0.0.6
Published
a babel plugin for remove some function call
Downloads
8
Maintainers
Readme
babel-plugin-transform-remove-funcall
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')
Install
# npm
npm i babel-plugin-transform-remove-funcall
# yarn
yarn add babel-plugin-transform-remove-funcall
# pnpm
pnpm i babel-plugin-transform-remove-funcall
Usage
// .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')
License
MIT License © 2024-PRESENT Jianxing Xu