babel / babel/minify

`transform-remove-console` exclude options not working on React Native project

Open
#950 8 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

I'm using the `exclude` options but it doesn't seem to have any effect as all logs are removed.

**To Reproduce**

`.babelrc`

```
{
"presets": ["react-native", "react-native-dotenv"],
"env": {
"production": {
"plugins": [ ["transform-remove-console", { "exclude": [ "error", "warn", "info"] }] ]
}
}
}
```

**Actual Output**

All `console.*` output is removed.

**Expected Output**

`console.warn`, `console.info` and `console.error` should still work.

**Configuration**

How are you using babel-minify?

"metro-minify-uglify"

**Additional context**

React Native 0.54.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.