Previously, dead code elimination pass of
swc dropped some used imports. It was cause by iteration order.
In the code below,
arr.map(...) are evaluated, the import statement is visited and incorrectly dropped
This is fixed by extracting import handling as a new phase. The new version of
swc does not drop imports while every other things are evaluated.