Which is why I'd wait until they make an offer as they are less likely to back out at that point as they've already made the decision to hire me whereas they might (even subconsciously) take it into consideration if I tell them before.
Also, getting offer is valuable information on what my current market rate it.
Just as long as you understand that some (many? most?) employers will not hire you once you tell them this.