Retailers such as Walmart and Target have been pouring money into their online businesses to fend off rival Amazon as the companies look to capture an even greater share of U.S. e-commerce sales.

While Amazon's reported sales growth each quarter includes that taken in from its other businesses, such as Amazon Web Services, the company is expected to capture nearly 5 percent of total U.S. retail sales by the end of this year, according to eMarketer. The data marketing firm has predicted Amazon will end 2018 capturing about 48 percent of U.S. e-commerce sales, or $252 billion, compared with 43.1 percent in 2017.

Some people have said Amazon gets a pass from investors on the investments it's made to grow sales, such as acquiring grocer Whole Foods. Analysts say investors are less concerned about Amazon turning a profit and care more about top-line growth. Traditional retailers such as Walmart and Target, however, continue to be punished by investors for announcing initiatives that drag on earnings.

Target offered the perfect example of that Tuesday, when its shares fell more than 10 percent after third-quarter earnings missed Wall Street expectations, thanks to increased transportation and labor costs, as e-commerce sales swelled. It was on track to lose more than $4.4 billion in market value.

Target said third-quarter digital sales climbed 49 percent, the best since the company started breaking out that metric. It said digital now accounts for 6 percent of its total sales, up from 4.2 percent a year ago, with stores making up the rest. It hasn't offered an outlook for e-commerce sales for the fourth quarter but said it expects profit margins will continue to be under pressure during the holidays, thanks to heightened supply-chain expenses.