Heterogeneous stacks of two-dimensional transition-metal dichalcogenides can be arranged so as to have a type-II band alignment, where the valence band maximum and the conduction band minimum are located on different layers. These structures can host long-living inter-layer excitons with inhibited charge recombination and enhanced charge-carrier separation. Inter-layer excitons appear as photoluminescence peaks below the band gap, but not in absorption experiments, indicating that they may form after and not during absorption. In order to quantify the inter-layer component of the absorption spectra of such heterostructures, we perform first-principles calculations of the layerdecomposed dielectric function of the HfS2/PtS2 hetero-bilayer. This has a type-II band alignment and a relatively small inter-layer distance, which should facilitate the formation of inter-layer excitons. We find that the inter-layer component is always only a small fraction of the total dielectric function, owing to the large spatial separation between the electron and the hole. However, the inter-layer contribution is greatly enhanced upon reducing the interlayer distance. Compression of the layers produces a split-off band at the top of the valence bands. This remains localised on PtS2 so that the heterostructure preserves the type-II character. At the same time the type-II bandgap is reduced, moving the inter-layer absorption peak to a lower energy and to a position well separated from the rest of the absorption spectrum. I.