Babel plugin strip any function call.
npm install babel-plugin-strip-function-callBabel 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 with npm:
npm install babel-plugin-strip-function-call --save-dev
Via .babelrc
``json`
{
"plugins": [
["strip-function-call", {
"strip": [
"console.log"
]
}]
]
}
In production only:
`json`
{
"presets": [
"es2015"
],
"env": {
"production": {
"plugins": [
["strip-function-call", {
"strip": [
"console.log"
]
}]
]
}
}
}
- strip: string[]
- specify to strip function names
For example, want to strip console.log(...).
Write following:
`js`
["strip-function-call", {
"strip": [
// not include ()
"console.log"
]
}]
`js`
["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.
See Releases page.
Install devDependencies and Run npm test:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
1. Fork it!
2. Create your feature branch: git checkout -b my-new-featuregit commit -am 'Add some feature'
3. Commit your changes: git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request :D
MIT © azu