Will it hurt the baby

Okay I'm 5'7 and 228 I was 276 but most of my fat going to my thighs and but I have a little belly pudge I was wondering while pregnant Is it okay to still trying to lose weight ?