The Hammers started the better of the two sides and their direct approach caused problems for Michael Laudrup's side in the opening stages.
New signing Matt Jarvis delivered a superb cross that Michel Vorm failed to deal with, and Kevin Nolan was inches away from giving the visitors an early lead.
Swansea's midfield started to settle into the game after withstanding the early pressure and a Rangel cross in the 15th minute just needed a touch from any player for the opening goal.
The home side didn't have to wait too much longer for a goal as Rangel once again found room on the right wing before firing a shot across Jussi Jaaskelainen and the former Bolton goalkeeper could only deflect the ball into the net.
Swansea were further ahead in the 28th minute when James Collins attempted a pass to Jaaskelainen but Michu took advantage of a sloppy ball from the defender to calmy slot the ball into the corner to extend his side's lead.
A superb save from Vorm denied Jarvis a debut goal for the Hammers and some stubborn defending in the closing stages of the first period ensured that the Swans went in at the break two goals ahead.