> Obviously yes. It's absolutely evident that the large majority of the economy of China is based on export towards rich countries. Without US investments China would be extremely poor.
You say obviously, yet fail to link why making China poorer would significantly affect military investment and which type. How much money does it take to throw people at software? And people are something China has a LOT of.
Depending on how you measure it, China's economy is between the 1st and 3rd largest in the world (I think first largest is a stretch, but there's apparently some metrics which rank it that way based on purchasing power).
The United states is not the only country that China exports to. It's a large chunk, and it would hurt, but as we're seeing, China is not willing to let the United States dictate everything in the relationship. Why would they let the United States use economics to tell them they can't research what they would describe as technologies used to protect themselves when they aren't willing to do so for lesser reasons, as evidenced by the current tariffs?
At most, we'll cause them to hide their activity. Why would they stop in light of the aggressive stance by other countries to dictate their future? North Korea certainly doesn't seem to like it, and China is in a position of much more power.
> Yet, the US decided to embargo communist Cuba (and Vietnam) and invest heavily in "communist" China. The latter being very capitalistic.
Well, yeah. Because doing otherwise hurts us economically, and economics drives a huge amount of decision making. And barring a concerted world effort to to China to stop investing in any military tech, while the rest of the world would undoubtedly continue, I doubt China would be willing to stop. It's not all that different than if some nations came to the United States and told us to stop researching and building up our military. We'd tell them it's none of their business and they have no say in what we do. Why would we expect China to act any differently?