Unused class declaration is not removed
Open
enhancement
- Dominant language
- JavaScript
- Stars
- 4.4k
- Forks
- 217
- PR merge metrics
- No merged PRs in 30d
Description
If you minify the following functions only one of the unused class declarations is removed.
```js
function fn(base) {
class foo extends base {}
}
function fn2(base) {
class bar extends base.prop {}
}
```
Becomes:
```js
function fn(a){}
function fn2(a){class b extends a.prop{}}
```
Obviously this is a contrived example but in my application this is causing a large tree of unused classes to make it into the client bundle.
I'm just testing on the command line with `babel`:
```
cat example.js | babel --presets=babili
```
Contributor guide
Assessment
This issue has not been assessed yet.