The Yankees’ formidable bullpen will play a huge role if they’re going to go far in the playoffs, but their rotation will have to do its part.

James Paxton once again showed he’s capable of dominating a lineup, as he allowed just an unearned run, three hits and no walks in six innings in a 7-2 win over Toronto on Saturday in The Bronx.

Giancarlo Stanton had two extra-base hits and homered for the first time since his return from a sprained right knee, with a sixth-inning blast, as the Yankees pulled away.

Aaron Boone was ejected for arguing balls and strikes from the dugout after the top of the first.

Paxton won his 10th straight start, as he continues to emerge as the Yankees’ ace. Since Aug. 2, he’s 10-0 with a 2.25 ERA.

With the return of Luis Severino and the postseason résumé of Masahiro Tanaka, the Yankees could have a solid rotation for the ALDS.

A Didi Gregorius error to start the top of the third led to the lone run scored against Paxton.

The struggling shortstop booted a routine grounder from ex-Yankee Brandon Drury. Richard Urena followed with an infield single and after Paxton struck out Luke Maile, Jonathan Davis delivered an RBI single to left for the game’s first run.

Paxton avoided further trouble in part because Urena was thrown out by Kyle Higashioka trying to advance to third on a pitch in the dirt. He ended up just allowing the unearned run in the frame.

The Yankees’ offense got going in the fourth. Aaron Judge started the rally with a leadoff double and scored on a one-out double by Stanton. After Gio Urshela lined out to center, Mike Ford singled to center to drive in Stanton, who looked fine running the bases.

Tyler Wade doubled to open the fifth when Teoscar Hernandez lost his fly ball to left. Wade then alertly stole third, as catcher Maile didn’t pay attention to him and held on to a pitch for too long.

Brett Gardner was then drilled by Thomas Pannone on his right arm on an 0-2 pitch. Gardner was picked off first after a review for the second out. Judge walked, but Gregorius whiffed to end the threat.

They added to their lead in the sixth, as Stanton homered into the left-field bleachers. Ford and Clint Frazier had back-to-back doubles with one out to make it 4-1, and Higashioka helped put the game out of reach with a two-run single through the right side of the infield to make it 6-1.

Jonathan Loisiaga gave up a run in two innings — and struck out five — before Chad Green struck out the side in the ninth.

Paxton, though, carried most of their load.

While the Yankees’ ability to score has never been in question, the status of the rotation has not been as clear.

Before the game, Boone said there was plenty of time to set up a plan for the ALDS.

“With [the series] not starting until Friday [Oct. 4], I feel that’s pretty easy to do,’’ Boone said.

He laid out a potential schedule that included Tanaka pitching the final game of the regular season.

“We’ll obviously watch and monitor what [the starters] do from now to the end of the season, so we feel we’re in a pretty good spot to go in whatever direction we decide on,’’ Boone said.