After years of internal debate about how to compete with Amazon.com Inc., Walmart Inc. boss Doug McMillon took the stage at a recent strategy meeting and revealed the centerpiece of his plan to thrive in an e-commerce era: giant stores.

Walmart, he told executives at the meeting, wasn’t going to win by building an unprofitable e-commerce operation or other stand-alone ventures. Instead, its supercenters could be the heart of a web of businesses all working together to attract shoppers and drive profits.

The...