Attacking a facility in another (presumably neutral) country is an 'act of war'. Depending who they attacked they might face an more powerful alliance than they bargained for; an alliance that once fully deployed could trash the Chinese military rather quickly.
Also, attacking another country would be long-term economic suicide for China. Moving manufacturing will not be cheap or easy short term but long term is probably necessary to stabilize worldwide supply chains.