Oh I'm so sorry you have to go through this.
I know what it feels like because the same thing happened to me. The details are different, i.e. I'm straight, was with a man (the baby's father). We were not married (although I'd thought maybe someday....) and lets see, I was a lot farther along in my pg, I found out about my "replacement", oh, like a week or 2 before the birth. I already knew her slightly (socially) and my impression of her: a rude, stuck-up poser, didn't like her at all, not to go into detail too much ...
Still, details are irrelevant IMO (or not very relevant) - being in love is being in love, and pregnancy is pregnancy, and having one's partner suddenly take up with a new person and express (implicitly &/or openly) that the new person is more important to them than all the intimacy you two have shared together. ... Well. What is there to say about that. I'm thinking it is a fairly common thing to happen unfortunately, and when it happened to me it was like being knocked to the ground and kicked around until everything hurt, and I could not breathe.
Pregnancy made it emotionally worse I'm SURE, IME definitely. I have been dumped before and since, but that time was worst b/c of pg and how I felt about X, I was a mess. He took a short time to "make up his mind" supposedly, but once the cat was out of the bag, it was only a short time before he told me we were over, because he chose her. I think within six months they were married & she was pregnant. I literally could not stand up straight, for weeks, months. I was at sobbing uncontrollably, buckets, even at work but could not take off (without really inconveniencing others) due to my maternity leave was going to begin very shortly thereafter, and I needed to meet with co-workers that would be covering for me. I don't think any of them asked what was wrong ... guess they figured I didn't want to talk about it ... which was TRUE for sure.
Got to admit ... this happened long ago - the kid I was pregnant with then, is now taller than I am ... but it still stings a bit sometimes. Particularly lately, as we recently had some stressful stuff happen that challenged our sorta longstanding coparenting truce a bit (led to arguments with X which made me feel pretty bad).
Btw the coparenting between us, & his parenting of ds at all, only exists at all b/c for years, I more or less forcd X to have a relationship of sorts with our child, b/c his wife "wouldn't let him" since she feared I would seduce him? which wasn't going to happen - the reason I was with him was b/c I didn't know about her until I did - but he allowed her to control him way lots IMO. But anyway, that's going a little OT but to complete my thought - Ds and his father are really close now but that certainly wouldn't be the case if I hadn't facilitated it for like 100% of the effort, the first several years, and I know it wasn't my job to see that X got to see his son frequently, but I'm really glad (for both their sakes) that I did it - well - Usually.
Of course - the marriage he left me for - didn't even last, maybe 3-4 years tops. Whatever! I did see that coming for sure.
OP - I hope you feel better soon ... and I think it does also help to be pg at such a devastating time, not only makes it harder. At least for me, it kinda forced me to take care of myself in a way I probably wouldn't have, had I not been carrying a baby.
Not sure what that smiley means but I hope it's something about wishing you some good vibes, love & light, because that's why I used it.