A plugin that removes logs (or removes any other code based on regex) from built code for the [Serverless Framework](https://serverless.com/).
npm install serverless-cleanup--stage prod when you run sls deploy), and safely keep the "log" log level)
sls deploy --stage prod or sls deploy --stage staging, the debug logs will be removed and the rest of the logs (like log and info) will be kept.
npm i serverless-cleanup
yml
plugins:
- serverless-plugin-typescript
- serverless-offline
- serverless-cleanup
`
#### Example:
`yml
custom:
cleanup:
currentStage: ${opt:stage, 'dev'}
jobs:
- dir: ./.build
logs:
- debug
comments: true
tidyup: true
patterns:
- console.error\(.*\);?
stages:
- prod
- staging
- dir: ./node_modules
logs:
- debug
- log
- info
stages:
- dev
- qa
- staging
- prod
``