Skip to content

jianxing-xu/babel-plugin-transform-remove-funcall

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •