babel / babel/minify

DCE TopLevel

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

Description

Add option in DCE to remove toplevel bindings. Other optimizations of DCE are applied to toplevel except places where a binding is removed.

```js
var foo = 0;
```

It is correct to NOT remove it as it is a Global variable. But there are contexts in which it might not be a global - places where the source-code is wrapped in a function (for a module system, maybe).

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.