The body's priority is to supply the fetus with nutrition. This means that you can lose weight with the foetus getting all the nutrition it needs on condition that you have a balanced diet. However, if you slim there might be an increased risk that your weight loss diet isn't balanced.
The grim famine in Holland during the last six months of the Second World War (caused by a German import prohibition) produced interesting results concerning pregnancy's effect on the newborn's weight. Those born to mothers who ate less than 600 calories a day during the first 6 months of their pregnancy were often overweight. However, if the mother ate less than 600 calories a day during the last 3 months the risk of overweight was less.
The experts believe that the reason for this is that the hypothalamus, the organ which controls appetite, develops during the first six months of the pregnancy. If the mother eats too little at this time, the hypothalamus gets excessive compensation for hunger which leads to overweight. Note that these results are based on investigations of women who ate less than 600 calories per day. It is not certain that these results apply to those women who slim more moderately.
Some women today become overweight during pregnancy because they neglect the normal surveillance of their eating and have difficulty in deciding whether they go up because of fatness or the growth of the foetus. It is therefore important to be extra careful with your diet in every possible way. At the beginning of the pregnancy calorie requirement isn't more than normal, and at the end it is a few hundred calories higher. During breastfeeding you need about a thousand calories more a day than normal.