Ben Rice accounted for all of the Yankees’ run production in Games 1 and 2 of the ALDS, clubbing a pair of homers at Tropicana Field.

That wasn’t enough for the Yankees to avoid losing both games to the Tampa Bay Rays, especially because the bases were empty for both of Rice’s blasts.

So as manager Aaron Boone attempted to awaken a dormant offense in Wednesday night’s win-or-go-home Game 3 in the Bronx, he assembled a new-look lineup that moved Trent Grisham to the leadoff spot and dropped Rice from No. 1 to No. 2.

“Just the potential of the on-base there, and trying to get some traffic created for Benny and [Luis] Garcia [Jr.] and [Cody Bellinger] there,” Boone explained pregame. “Considered it a lot of different ways.”

The lefty-swinging Grisham was the Yankees’ primary leadoff hitter for most of the season, but he hadn’t batted in that lineup spot since returning at the start of the playoffs from a nearly month-long stint on the injured list due to a right hamstring strain.

Throughout Grisham’s absence, the lefty-hitting Rice served as the Yankees’ leadoff batter against right-handed pitching — a role he remained in during the Yankees’ first three matchups against righties in the playoffs.

But that changed Wednesday against Rays right-hander Nick Martinez, a reverse-splits pitcher who is tougher on left-handed hitters than righties.

It was something of a bold decision, considering Grisham entered Wednesday just 2-for-10 in the playoffs; batted seventh in each of his first three postseason starts; and struggled from the leadoff spot this year.

During the regular season, Grisham batted .199 with 13 home runs and a .680 OPS as the Yankees’ No. 1 hitter and just .104 with one homer and a .420 OPS in the first inning of those games.

When hitting anywhere other than first in the order, Grisham batted .243 with seven home runs.

Still, the Yankees appreciate Grisham’s patience and control of the strike zone. His 12.6% walk rate ranked in MLB’s 88th percentile, according to MLB’s Statcast data, while his excellent 19.2% chase rate — or the percentage of pitches out of the strike zone he swung at — ranked in the 99th percentile.

“When Trent’s at his best, obviously, he’s got that ability to get on,” Boone said.

Overall, it was a difficult season for Grisham, an impending free agent who hit .211 with 18 homers and a .703 OPS and endured two separate IL stints due to right hamstring injuries.

But in a must-win game, the Yankees turned to the veteran to be a table-setter for Rice, who followed up his breakout 41-homer regular season with four home runs and eight RBI in the Yankees’ first four playoff games.

That was one of several Game 3 lineup changes made by Boone, who also started Anthony Volpe over Jazz Chisholm Jr. at second base; José Caballero over Ryan McMahon at third base; and moved hot-hitting catcher Austin Wells to the No. 6 hole.

Wells had batted no higher than eighth in any of the first four playoff games.

“Hopefully,” Boone said of the transformed lineup, “it will be a little spark for us.”