Taiwan should make everything in those factories easily transportable.
China invades…..everything comes to Korea or US.
A possible problem is that the invasion might not be first; bombing those fabs into oblivion might be first, and then the invasion. If China can get by on what chips it can itself manufacture, then such an attack would cripple the rest of the world without harming itself.