The Yankees’ offense continues to produce, even with two of the team’s most dangerous hitters in lengthy slumps.

Gary Sanchez entered Tuesday’s game against the Orioles with just one hit and five strikeouts in 11 at-bats since he returned from the injured list. Prior to the IL stint (for a groin strain), Sanchez had been mired in an 18 at-bat hitless streak.

Aaron Judge entered Tuesday in an even lengthier slide, with just one homer in his previous 18 games, along with 12 walks and 23 strikeouts.

“He’s working to get right and when he does, look out,’’ Aaron Boone said before the game of what the lineup will look like once Judge gets going.

Perhaps Tuesday’s 8-3 victory was a positive step, as Judge lined to third on a 3-0 pitch in the first, with the out clocked at 115.3 mph and added a two-run double to left in the fourth inning.

“It was good to get a result and an extra-base hit,’’ Boone said. “Hopefully it’s him starting to get more comfortable.’’

Boone said Sanchez had been dealing with “zone control” issues. Tuesday, Sanchez, as the DH, had a run-scoring double in the fourth.

“If he controls the zone, the swing is special,’’ the manager said. “The talent is special. He’s just leaving the zone a little bit too much.”

Asked why that was the case, Boone pointed to the time missed because of the injury as a possible reason.

“He was struggling before the injury and then has to reestablish timing,’’ Boone said.

But Boone said he remains confident both sluggers would regain their form soon.

“Then, buckle up,’’ Boone said.