The CCP decided many decades ago that economic growth was absolutely necessary for them to stay in power because it is required in order to maintain social stability. An economy with hundreds of millions of unemployed peasants in the countryside, and feeble industries was not sustainable. This is why they purged a bunch of ideological marxists and embraced communism with Chinese characteristics, AKA Capitalism.
For a long time the CCP maintained that 7%+ economic growth was necessary in order to absorb the unused labour pool and maintain social stability.
Needless to say a war with Taiwan and the US, plus blockades by the rest of the world would be a somewhat risky situation from a social stability point of view. It would be a complete throw of the dice, and for all Chinese people love gambling with money, that's not the CCP way with politics.