We report that the refractive index of transition metal dichacolgenide (TMDC) monolayers, such as MoS2, WS2, and WSe2, can be substantially tuned by > 60% in the imaginary part and > 20% in the real part around exciton resonances using CMOS-compatible electrical gating. This giant tunablility is rooted in the dominance of excitonic effects in the refractive index of the monolayers and the strong susceptibility of the excitons to the influence of injected charge carriers. The tunability mainly results from the effects of injected charge carriers to broaden the spectral width of excitonic interband transitions and to facilitate the interconversion of neutral and charged excitons. The other effects of the injected charge carriers, such as renormalizing bandgap and changing exciton binding energy, only play negligible roles. We also demonstrate that the atomically thin monolayers, when combined with photonic structures, can enable the efficiencies of optical absorption (reflection) tuned from 40% (60%) to 80% (20%) due to the giant tunability of refractive index. This work may pave the way towards the development of field-effect photonics in which the optical functionality can be controlled with CMOS circuits.