Dissenters were quick to react when ModCloth, an online seller of trendy women’s clothes and accessories, was acquired by retail giant Wal-Mart Stores Inc. last month.

“You have disappointed us all,” one reader commented under a blog post by ModCloth co-founder Susan Gregg Koger announcing the sale — the notion being that ModCloth would lose its cache as part of a discount mass merchant. “I’m done shopping with you,” wrote another.

But Gregg Koger noted that Wal-Mart would give ModCloth “the necessary resources and support that we need as a business to grow.”

ModCloth is one example of how Wal-Mart is belatedly but aggressively expanding its e-commerce business to keep pace with the seismic shift in consumer shopping from bricks-and-mortar stores to the internet.

With nearly half-a-trillion dollars in annual sales and 4,700 U.S. stores, Wal-Mart has been buying online retailers, slashing shipping rates and rolling out new ways for in-store customers to do more of their shopping at Walmart.com and its other websites.

While traditional U.S. in-store retailing is growing less than 2 percent a year, forcing many retailers to close stores, e-commerce is growing 16 percent annually, the research firm EMarketer Inc. reports. E-commerce sales this year will hit $462 billion and soar to $789 billion by 2021, the firm estimates.

Wal-Mart’s effort to tap that online growth often is portrayed as a direct attack on Amazon.com Inc., the online-retailing behemoth.

Wal-Mart prefers to frame its strategy as capturing more of the e-commerce market by blending its in-store, online and mobile-app offerings so that customers can easily move from one to the other to make purchases. If it snatches business from Amazon in the process, all the better.

One of Wal-Mart’s key acquisitions was Jet.com Inc., which also sells a wide variety of consumer products and groceries. Wal-Mart paid $3.3 billion for Jet.com last year and then named Jet.com Chairman Marc Lore to head its entire U.S. e-commerce operation.

“It was a radical signal to everyone that the biggest retailer in the world was willing to put $3.3 billion into the (online) market,” said Adrien Nussenbaum, chief executive of Mirakl, a developer of software products for retailers and other firms.

Under Lore and Wal-Mart Chief Executive Doug McMillon, Wal-Mart has taken several other steps to bolster its e-commerce sales, including:

• Acquiring Shoebuy.com, an online footwear retailer, and Moosejaw.com, an online seller of outdoor apparel and gear. Those retailers and ModCloth continue operating as separate websites.

• Launching free two-day shipping for orders of $35 or more at Walmart.com, Jet.com and many of its other sites.

• Boosting the stock on its virtual shelves. At the start of 2016, Walmart.com had 8 million items for sale; today it has more than 35 million items.

• Launching a program that allows in-store customers to go online or check their phone app to see a list of items they have bought, then reorder those items online.

• Rolling out a groceries program whereby customers order items online and then have the groceries loaded into their vehicle at a Wal-Mart store.

• Forming a division called Store No. 8 that’s intended to hatch new online retail approaches and businesses.

Wal-Mart said in October that it was going to slow the pace of new store openings this year, in good part to shift investments to its e-commerce business.

“We’re being pretty active,” Lore said during a recent tech gathering, called Code Commerce, in Las Vegas.

“We’re behind. We need to catch up. There are some big things we have in the works,” said Lore, who spent two years with Amazon after it bought his previous online venture, the parent of Diapers.com and other sites.

Wal-Mart is the second-largest online mass merchandiser behind Amazon, but it’s a distant second. Amazon’s product sales totaled $94.7 billion last year while Wal-Mart’s tallied $14.4 billion, according to EMarketer.

Amazon, with $136 billion in total sales last year, has other assets and services as well, namely a variety of video, entertainment and other services available through its Prime membership.

Prime also provides free shipping on Amazon purchases, and analysts estimate about 65 million Amazon customers subscribe to Prime for $99 a year. (Amazon doesn’t disclose the number except to say it has “tens of millions” of subscribers.)

Stephen Beck, founder of the management consulting firm Cg42, said Prime gives Amazon customers more incentive to shop at the site. Prime customers spend an average of $270 a year above what they were spending at Amazon before subscribing, he said.

“One of the things Amazon does really well is to highlight the value of the Prime subscription,” Beck said. “Wal-Mart is a retailer and proudly so, but Amazon is more than that.”

Amazon spokeswoman Sally Fouts would not comment about Wal-Mart’s specific online ventures, but she said, “We’ve had competition every day of our existence at Amazon, and it’s never changed our approach.

“We obsess over customers and the things we believe customers will always care about — low prices, vast selection and fast delivery.”

Amazon’s efforts extend to a grocery delivery service in certain areas called Amazon Fresh. It’s also begun testing its own grocery pickup service in Seattle, where Amazon is headquartered.

Although Wal-Mart is well behind Amazon in e-commerce, Wal-Mart has the scale and resources to make a much bigger splash in online shopping.

The Bentonville company, which also owns the Sam’s Club chain, posted total sales of $482 billion in its fiscal year that ended Jan. 31. The company says its 4,700 U.S. stores are located within 5 miles of 70 percent of the U.S. population, and it has an enormous distribution network in place. More than 140 million people shop at its stores and Walmart.com in the U.S. every week.