Does the Sharpshooter feat work on spells cast through a ranged weapon being used as a spellcasting focus?

I’m asking as a player:

Does the Sharpshooter feat’s 3rd clause (-5/+10) work on spells cast through a ranged weapon being used as a spellcasting focus?

Specifically, does the Sharpshooter feat work with spells cast through a Warlock’s Improved Pact Weapon shortbow/longbow/crossbow options?