nothing illegal about the idea in general, however
many things you bought have export control. that means if you want to export it to some other country, you have to apply for permit. and there are a lots of restrictions on sensitive technology, such as things that could be used in a weaponry.
so you need to be extremely careful to comply with the US law.
on top of that, China still charges quite a hefty tariff on certain things. So you need to make sure you pay that as well to comply with Chinese law.