  The stellar structures of star-forming galaxies (SFGs) undergo significant
size growth during their mass assembly and must pass through a compaction phase
as they evolve into quiescent galaxies (QGs). To shed light on the mechanisms
behind this structural evolution, we study the morphology of the star-forming
components of 665 SFGs at 0<z<2.5 measured using JWST/MIRI observation and
compare them with the morphology of their stellar components taken from the
literature. The stellar and star-forming components of most SFGs (66%) have
extended disk-like structures that are aligned with each other and are of the
same size. The star-forming components of these galaxies follow a mass-size
relation, similar to that followed by their stellar components. At the highest
mass, the optical S\'ersic index of these SFGs increases to 2.5, suggesting the
presence of a dominant stellar bulge. Because their star-forming components
remain disk-like, these bulges cannot have formed by secular in-situ growth. We
identify a second population of galaxies lying below the MIR mass-size
relation, with compact star-forming components embedded in extended stellar
components (EC galaxy). These galaxies are overall rare (15%) but become more
dominant (30%) at high mass ($>10^{10.5}M_\odot$). The compact star-forming
components of these galaxies are also concentrated and slightly spheroidal,
suggesting that this compaction phase can build dense bulge in-situ. Finally,
we identify a third population of SFGs (19%), with both compact stellar and
star-forming components. The density of their stellar cores resemble those of
QGs and are compatible with being the descendants of EC galaxy. Overall, the
structural evolution of SFGs is mainly dominated by a secular inside-out
growth, which can, however, be interrupted by violent compaction phase(s) that
can build dominant stellar bulges like those in massive SFGs or QGs.
