Acquiring wavelength information about unknown light using a single photodetector is important for both fundamental investigations and industrial inspections. Miniaturized spectrometers with a compact size have been demonstrated on a single photodetector based on the spectral modulation and a reconstruction algorithm. Here, we demonstrate a miniaturized spectrometer based on a strained two-terminal MoS2/WSe2 heterostructure device by enhancing spectral modulation. The strain is induced by Au fingers, which would locally tune the electronic band structure of the heterostructure and introduce a plasmonic effect to locally enhance the absorption. Importantly, those Au fingers could alter the local electric field distribution, further enlarging the spectral differences. The as-fabricated photodetector exhibits a responsivity of 9.8 A/W and a detectivity of 5.6 × 1012 Jones at a bias of 2 V. Importantly, the photodetector can probe wavelengths from 550 to 900 nm with a spectral resolution of 3 nm and an average accuracy of 0.24 nm.