[0] https://en.wikipedia.org/wiki/Depopulation_of_the_Great_Plai...
Just having more online services like future-Amazon seems like money would leave the economy and destroy the town faster than building a Walmart does.
Laborers would have a role to play with exoskeletons, being the eyes on the ground, and directing the robotic labor. Technicians would maintain the systems, and managers would organize logistics and resources. And as long as there is industry, there will be all the other types of supplementary businesses and jobs that come with a town.
The second problem is that globalization and efficiency might mean there is nothing for the factory to do that anyone wants to pay for.
When I say "most", I am not kidding. A few studies tell that something between 70% and 80% of people living in Paris would like to move away! That's huge.
Residential-only suburbs were built with free money to create the road network, but produce no value, so they're running on loans but can't actually pay for anything. That's why many of had to start using speed traps for income.
http://www.strongtowns.org/the-growth-ponzi-scheme/
http://www.strongtowns.org/journal/2012/1/2/the-cost-of-auto...
http://www.strongtowns.org/journal/2014/8/25/stroad-nation.h...
The Rust Belt may have died, but not because they took too many loans!
One big datapoint here is the most recent election: Trump won several thousand counties to Clinton's several hundred. This was mimiced up- and down the ballot and was almost perfectly divided as a cities vs. everyone else thing.
You cannot escape economic reality no matter what the vote buyers think.