A Chinese invasion of Taiwan would look nothing like Russia’s invasion of Ukraine. China could attack Taiwan with fires from the mainland, there isn’t a deep depth of terrain within which to hide. It would be more about resisting an occupying force than trying to meet them on the battlefield.
The deterrence here isn’t in stopping an invasion, but from making the fallout so costly that it wouldn’t be worth it. Just rigging the TSMC plants with explosives and blowing them up when an invasion starts would accomplish deterrence more effectively than having soldiers shoot at each other. The unified economic sanctions of Russia after the invasion of Ukraine has been extremely costly and acts as a major message of deterrence against China trying to take Taiwan and risking reduction to the foreign trade that’s so vital to their stability (which is why they’re to develop their domestic market to reduce economic dependence).
Taiwan should stay independent, but it doesn’t make sense to have a lot of people bleed for it.
There should be no illusions about resisting an attack. That’s not really possible in the modern transparent battlefield. All fixed defenses are struck in the opening salvo, AA defenses, radar networks, airfields. China would take immediate air superiority. Amphibious assaults are ridiculously dangerous, nigh impossible, but every shot fired in defense receives immediate retaliation from the air. This is different from the war in Ukraine where there’s contested airspace instead of one-sided superiority. Mines will slow the landing but without the ability to resist it, its just a matter of time. Deterrence needs to be economic and political, a military deterrent is not going to work on the doorstep of a world power with anything short of nuclear armament.