Skip to content

Latest commit

 

History

History
69 lines (58 loc) · 2.15 KB

File metadata and controls

69 lines (58 loc) · 2.15 KB

babel-plugin-transform-remove-funcall

npm version npm downloads bundle JSDocs License

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