I sort of did what
@donkpow did with my 2010 Impreza. It had a small squeak in one of the bearings when I bought it in late 2014.
I bought both bearings from my local dealer, I don't recall the price, but it was fairly cheap, I want to say under $20.
I pulled the alternator apart, this took some patience, as a couple of the fasteners were corroded in there pretty good. For a 4 or 5 year old car, it was pretty abused and neglected. You could say it had a hard 83,000 miles on it.
Then cleaned everything. Actually I had access to a bead blaster at the time, and removed all the oxidation and rust, then clear spray painted the aluminum and painted the middle black it so it would stay nice looking.
It went pretty well, but you'll need an impact to get the nut off to remove the pulley. And to reinstall it. Unless you want to risk damaging the pulley trying to hold it.
It still worked and looked brand new at 230,000 miles when I traded it in. It still had the original brushes, etc. Everything but the bearings.
If you don't have patience, or basic mechanical skills, I don't recommend a rebuild on your own. There are some semi fragile parts that won't survive...