This has been a bad week for many retailers and their stocks, but not for Amazon.com (AMZN - Get Report) . The SPDR S&P Retail (XRT - Get Report) , an exchange-traded fund designed to track the broad retail sector, is down 3.0% for the past five days, but shares of Amazon have gained 5.3%. Traditional retailer Macy's reported weak earnings this week, causing its stock to sputter and weighing on shares of some of its peers. 

Bricks-and-mortar retailers have shown that they are having a difficult time adapting to online competition, while Amazon continues to increase market share.

Retail sales data for the U.S. released Friday confirmed this trend. Retail sales grew 1.3% in April from March, the government said. That was the best pace in more than a year, The Wall Street Journal noted. That headline number might look great for traditional department store retailers, but a look at the details of the report shows otherwise. The increase was driven by three categories, The Wall Street Journal noted: autos, gas stations and nonstore retailers. Guess who's the major player in that last category?

The chart below signals just how dominant Amazon has been over the broader retail sector over the past 10 years. The chart plots Amazon's share price against the price of SPDR S&P Retail.

Since early 2015, Amazon has outperformed its bricks-and-mortar peers by more than 180% and counting. While Amazon has been trending higher since 2007, the recent outperformance signals that a large consumer push to online platforms, via apps and other means, is gaining momentum.

Until companies such as Macy's, Nordstrom and JC Penney figure out a way to combat Amazon's growing market share, investors should avoid owning shares of traditional retailers.

This article is commentary by an independent contributor. At the time of publication, the author held a short position in retailer L Brands (LB).