The era of massive factories with thousands of workers is ending.