The government made the companies start accounting for externalities like not poisoning the rivers and not having the workers fall entirely on the government dole the instant they retire. So companies did what they do and went to countries that didn't care about protecting the environment or populace. Blaming the government for this state of affairs is misguided.
Sadly the TPP was abandoned along with the significant environmental and worker protections it would have imposed, neither of which I can see being a feature of China's replacement for it.