Commit fd997d3
feat(es/minifier): Respect more options (#8582)
**Description:**
This PR makes the ES minifier respect more options.
Changes:
- `reduce_vars` now enables IIFE invoker.
- `reduce_vars` now enables seq inliner.
- `top_retain` is now respected by seq inliner.
- `arguments` is now ignored by seq inliner.
---------
Co-authored-by: austaras <austaras@outlook.com>1 parent 507c469 commit fd997d3
File tree
36 files changed
+175
-208
lines changed- crates/swc_ecma_minifier
- src/compress/optimize
- tests
- fixture/next/56408
- terser/compress
- drop_unused
- issue_t161_top_retain_14
- issue_t161_top_retain_3
- vardef_value
- functions
- issue_2663_3
- issue_2842
- issue_1609
- chained_evaluation_1
- chained_evaluation_2
- issue_1656/f7
- reduce_vars
- boolean_binary_assign
- cond_assign
- defun_reference
- iife_assign
- immutable
- inner_var_for_in_1
- issue_1595_2
- issue_1595_3
- issue_1670_1
- issue_1670_2
- issue_1670_3
- issue_1670_4
- issue_1670_5
- issue_1814_1
- issue_1814_2
- lvalues_def_2
- toplevel_on_loops_1
- toplevel_on_loops_2
- var_assign_1
- var_assign_2
- var_assign_5
- var_assign_6
36 files changed
+175
-208
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
434 | 436 | | |
435 | 437 | | |
436 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
2041 | 2041 | | |
2042 | 2042 | | |
2043 | 2043 | | |
| 2044 | + | |
2044 | 2045 | | |
2045 | 2046 | | |
2046 | 2047 | | |
| |||
2062 | 2063 | | |
2063 | 2064 | | |
2064 | 2065 | | |
2065 | | - | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
2066 | 2074 | | |
2067 | 2075 | | |
2068 | 2076 | | |
| |||
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
560 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
561 | 570 | | |
562 | 571 | | |
563 | 572 | | |
| |||
612 | 621 | | |
613 | 622 | | |
614 | 623 | | |
615 | | - | |
| 624 | + | |
616 | 625 | | |
617 | 626 | | |
618 | 627 | | |
| |||
1513 | 1522 | | |
1514 | 1523 | | |
1515 | 1524 | | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
1516 | 1535 | | |
1517 | 1536 | | |
1518 | 1537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
122 | | - | |
123 | 121 | | |
124 | 122 | | |
125 | | - | |
126 | | - | |
127 | 123 | | |
128 | 124 | | |
129 | 125 | | |
| |||
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
162 | | - | |
163 | 158 | | |
164 | 159 | | |
165 | 160 | | |
| |||
297 | 292 | | |
298 | 293 | | |
299 | 294 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | 295 | | |
305 | 296 | | |
306 | | - | |
307 | 297 | | |
308 | 298 | | |
309 | 299 | | |
| |||
0 commit comments