For a while, Amazon (AMZN -0.22%) may have seemed invincible. The company steadily increased annual revenue and profit over the past five years. Over the same time period, Amazon's stock price climbed from less than $800 to more than $3,000 per share. But in recent months, the situation hasn't been as bright. Inflation and supply chain problems have weighed on the company, and earnings and share price have suffered. The stock has lost 30% year to date.

At the same time, Amazon may be heading for a new chapter. The company plans on a stock split in June. This will bring down the price per share, opening the door to a broader range of investors. Is Amazon a buy before this new chapter begins? The answer is "yes." Here's why.

An investor holds a pair of eyeglasses and studies a document in front of a laptop.

Image source: Getty Images.

An e-commerce giant

When you think "Amazon," you may also think "e-commerce giant." And that's one reason I'm optimistic about this stock today. In the U.S. alone, Amazon is set to make up more than 41% of total retail e-commerce sales this year, according to Insider Intelligence. The research firm predicts that e-commerce will top $1 trillion in the U.S. for the first time in 2022 -- and $5 trillion worldwide. So this is a growing market, and Amazon has a significant share.

Now let's talk about the headwinds facing the retail business. Some are beyond Amazon's control, such as inflation. The bad news is that high inflation could persist for quite a while. But the good news it's still a temporary issue; it won't be around forever.

Here's some more good news: Amazon can control certain headwinds -- such as productivity and matching capacity to demand. In fact, Amazon says two thirds of the first quarter's $6 billion in incremental costs are within the company's control. So right now, Amazon aims to make the company's fulfillment network more cost-efficient. And it's working on increasing productivity across the network.

In other moves to bolster earnings, Amazon earlier this year raised the subscription fee for its U.S. Prime membership. Prime is a key reason why Amazon is set to continue dominating in e-commerce. In the first-quarter earnings call, Amazon said Prime members have significantly increased their spending since the early days of the pandemic. Member renewal rates continue to be high. And the company also notes that members are depending more and more on Amazon for shopping and entertainment. The number of Prime members surpassed 200 million by early 2021; since then, the company says it's added millions of new members. So, in my view, the short-term headwinds don't change the bright long-term prospects for Amazon's e-commerce business.

Cloud computing leadership

There's a second reason to be optimistic about Amazon: That's Amazon Web Services (AWS), the company's cloud computing business. AWS is the leader in cloud computing worldwide. It's maintained market share of 32% to 33% over the past several years, according to Synergy Research Group. And, importantly, AWS is a big profit driver for Amazon. It provided more than 70% of Amazon's total operating income last year.

AWS continues to deliver double-digit growth in revenue and operating income. That's likely to continue; AWS is expanding its infrastructure worldwide to better support current customers and serve new ones. So AWS is winning today -- and it should continue to win well into the future.

Now, let's look at the upcoming stock split. Could that boost Amazon? It may lift the shares in the very short term. Some investors who didn't want to invest thousands of dollars in one share or buy fractional shares may decide to give Amazon a try at the lower price.

But the split isn't a reason for the stock to rise over the long term. Instead, I expect the strength of Amazon's e-commerce and cloud computing businesses to help push the shares higher. And that's why, for the long-term investor, Amazon is a great stock to buy now.