France added an insurance goal in the 79th minute, when superstar Kylian Mbappé drew four Moroccan defenders toward him in the box before he slipped a pass to Muani, who scored from close range.
The Frenchmen, winners of soccer's most coveted trophy in 1998 and 2018, are seeking to become the first team to win back-to-back World Cup titles since Brazil did it in 1958 and 1962.
French manager Didier Deschamps said he's overjoyed for his team and hopes his players have been able to relish their time in the tournament.
'"I tell this to my staff and to my players: Take every moment during the day to really appreciate and savor the moment," Deschamps said. "In four days, we're going to play for a world title, and we're really going to enjoy it."
And in a sweet moment after Wednesday night's match, Mbappé embraced Morocco's Achraf Hakimi, his good friend and teammate at Paris Saint-Germain. They exchanged shirts, and Mbappé celebrated with French fans wearing Hakimi's No. 2 Morocco shirt.
On the other side of Sunday's massive match, 35-year-old Argentine legend Lionel Messi and his teammates will seek to capture their country's first World Cup title since the 1986 tournament, best known for Argentina's quarterfinal victory over England, thanks in part to Diego Maradona's "Hand of God" goal.
Even as one of his sport's greatest players, Messi has long been the unfair target of frustrated fans back home for the national team's failure to win the World Cup.
Argentina won the Copa America, the South American championship, last year, with a 1-0 victory over host Brazil in the final, but demanding supporters of La Albiceleste — so named for their sky blue and white uniforms — won't be satisfied until Messi raises the World Cup.
Bookmakers put Sunday's title match at even odds.
The title match is set to kick off at 10 a.m. ET from Lusail Stadium in Al Daayen.
Morocco, which captured the world's imagination as the first African side to ever make the World Cup semifinals, will play for third place Saturday against 2018 runner-up Croatia at Khalifa International Stadium in Ar-Rayyan.
The next World Cup will be in North America in 2026, with the U.S., Canada and Mexico serving as hosts.