There is a simple solution to this. Proactively offer them raises that will encourage them to stay instead of taking off for an immediate 20-40% pay bump.
Or maybe take stock of the complexity of the software running your business and figure out how much is tech debt, how much is long-redundant features, and how much is resume-padding and chasing trends.