feat(next-swc): Add CJS optimizer again (#50249)
### What?
This reverts commit 6ebc725fe6231ce45cab03aac9dc9b9e2f057a2f / #50247.
### Why?
#49972 is reverted due to bugs, and I'm retrying it.
### How?
Closes WEB-1072
Closes WEB-1097
Closes NEXT-1156 (as it's reopened by the revert PR)
fix #48469
---------
Co-authored-by: Shu Ding <g@shud.in>