CHICAGO — Uber's path to profitability will go through its food delivery service, Uber Eats, an analyst at Morningstar said Wednesday.

Ali Mogharabi, equity analyst at Morningstar, said Uber Eats is growing at a rapid rate and has already taken a large chunk of market share from competitors like GrubHub.

In a panel at the company's annual investment conference, he said Uber Eats now accounts for over 25% of all U.S. food-delivery and takeout orders; that's up from about 11% a year and a half ago. Meanwhile, GrubHub's share of delivery and takeout orders have gone down to less than 40% from more than 60% in the same time period.

"There are actually a lot of Uber riders that, while they're getting a ride in an Uber, they're also ordering food from Uber Eats to arrive to their home by the time they get there," Mogharabi said. "You're basically looking at marginal cost, or cost per transaction completed, declining over time ... We think that's one of the reasons why margins are going to widen and why Uber will go toward profitability going forward."

Uber is expected to join the public market later this week in one of the most anticipated initial public offerings in recent memory.

The ride-sharing giant, CNBC learned through sources, set a price range of $44 to $50 per share for its IPO. This would value it between $80.53 billion and $91.51 billion.

However, profitability is a big question mark facing Uber. In 2018, Uber lost $1.8 billion and $2.2 billion in 2017.

"Uber Eats, we actually think is very critical," said Mogharabi, noting the company could become profitable by 2024 thanks in part to Uber Eats' growth.

Subscribe to CNBC on YouTube.