babel / babel/minify

Multiple passes?

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

Description

Are there situations that we might need multiple passes for better minification ?

For example, one plugin might transform

``` js
if (a) foo (x) : foo (y);
//to
a ? foo (x) : foo (y)
```

and another plugin might transform

``` js
//to
foo (a ? x : y);

// or even,
x ? foo(a) : foo(b)
//to
foo (x ? a : b)
```

and another one could remove this as pure expression statement. or modify it differently. I'm not able to think about it.

So the order of plugins in the preset will matter, and we say (with plugins- a and b) the order is `a, b`, and another particular transformation might require the order to be `b, a`. So, should we explore multiple passes. I'm not sure if this is a problem. Just asking if there are situations that you faced like this.

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.