Firefighters were called to the scene in Craigton Place, Winchburgh, at about 01:30 after a wheelie bin was set on fire.
The bin had been resting against the house, which caused the fire to take hold quickly.
Firefighters swiftly extinguished the blaze, when it was discovered that a gas pipe had been damaged in the fire.
Thirty homes in the area were evacuated, with 38 residents temporarily housed at a local community centre.
They were eventually allowed to return home at about 06:30.
'Young children'
Police are treating the blaze as wilful fire-raising and appealed for information about the West Lothian incident.
They are keen to trace anyone who may have seen someone in the area just before the bin was set alight.
Det Con Adrian Wallis said: "This was a serious incident which could have had devastating consequences.
"It also resulted in the evacuation of over 30 people, including young children and elderly residents. This caused much alarm and upset to those who had to leave their homes in the middle of the night.
"Anyone who saw anything suspicious at around 01:00, or has any other information regarding this incident, is asked to contact us immediately."
Thirty homes had to be evacuated after a gas pipe was damaged in a fire that was started deliberately.