Is it possible to lose weight if obese while pregnant?

I'm in the obese category with BMI, and I'm 5'3" so pretty short. Probably 40 lbs overweight. Is it possible to lose weight while pregnant if I eat healthy and work out, losing fat while gaining baby weight? I've never been so healthy in my life-- trying so hard so that I can have a healthy pregnancy!