Carlos Carvalhal's rejuvenated side took the lead after eight minutes through Ki Sung-yueng.
Winston Reid was then hurt following an awkward fall when clearing a Swansea corner. Following a lengthy delay of some 10 minutes, the New Zealand international was eventually taken off on a stretcher, his neck in a brace.
Dutchman Mike van der Hoorn doubled the hosts' lead after 32 minutes, heading in at the back post. It was 3-0 early in the second half when Andy King, on loan from Leicester, stabbed the ball in from close range.
Jordan Ayew added a fourth from the penalty spot after 63 minutes, before Irons substitute Michail Antonio netted a late consolation. The Swans climb above West Ham on goal difference into 13th place.
“This afternoon we saw rock and roll football at the Liberty," Carvalhal said.
“There are moments in football where you must dance to the music of the opponents.
“We made things very difficult for West Ham I think. It was the best performance since I arrived and this is nearer to what I want from the team – offensively, defensively, in transitions and at set-pieces.
“We are happy that we won, but we still have a long way to go."