gaining weight for delivering early?

My doctor said the more weight you gain, the more your baby gains (at least in my case) 
They told me i will most likely deliver before 30 weeks due to complications. They also said if she's too small, there's higher chance she wont survive. 
My husband brought this idea of if I eat more (healthy too) to gain more weight, to help the baby get a little bit bigger.
At first I was like "no, thats stupid, it wouldnt work" 
But the more i think about it, the more it makes sense. I gain weight, and the lose it, pretty much each appointment. I am 20 weeks and see 2 doctors, once a week, or every other week. I've noticed when i gain weight, she does too. 
Would this be a stupid idea?
Uodate: I realized I wasn't clear enough. I know if you lose weight it doesn't mean the baby does. I'm just scared that the baby will be too small to survive. I'm 21 weeks today and she just hit 15oz. Most weight you gain is in your third trimester but if im having her before 30 weeks, it doesn't give her much time. So i was wondering if i gain more weight, if it will help her be a little bit bigger so she has a better chance at surviving. I know there are risks with larger babies, I just want her to surivive..