azu / Babel Plugin Strip Function Call
Licence: mit
Babel plugin strip any function call.
Stars: ✭ 36
Programming Languages
javascript
184084 projects - #8 most used programming language
babel-plugin-strip-function-call
Babel plugin that strip any function call.
This is simiar with yahoo/strip-loader: Webpack loader to strip arbitrary functions out of your production code..
Install
Install with npm:
npm install babel-plugin-strip-function-call --save-dev
Usage
Via .babelrc
{
"plugins": [
["strip-function-call", {
"strip": [
"console.log"
]
}]
]
}
In production only:
{
"presets": [
"es2015"
],
"env": {
"production": {
"plugins": [
["strip-function-call", {
"strip": [
"console.log"
]
}]
]
}
}
}
Options
-
strip
:string[]
- specify to strip function names
For example, want to strip console.log(...)
.
Write following:
["strip-function-call", {
"strip": [
// not include ()
"console.log"
]
}]
Notes
["strip-function-call", {
"strip": [
// not include ()
"console.log"
]
}]
The pattern don't strip console["log"](...)
by design.
If you want to strip computed method pattern, please file issue.
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test
:
npm i -d && npm test
Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].