i'm gonna play devil's advocate and say tw's best chance is to drag the invasion out to as long as humanly possible in order to garner as much international attention/support as possible, just like what Ukraine is doing to russia at the moment.
hand out atgms/manpads to small teams and civilians and deploy in every single taller than 5 stories buildings in all of the cities.
either make it so hostile to the PLA ground forces that they can't move one inch into any city without losing manned/unmanned armored units, or force their hand into razing every single building to the ground in order to eliminate one threat, which will ensure the absolute long lasting hatred of the locals toward PLA/china for generations to come, making conquering tw as costly as possible.
even if PLA has hordes of drones and smart munitions, clearing each building is going to be extremely time consuming and costly, especially if they want to "preserve" the local infrastructure. and if they decide to categorically destroy all potential buildings of threat, then they'll be committing an even greater atrocity.
but like previous posters said, this heavily depend on the taiwanese will to fight when they clearly know it's just delaying the inevitable by sacrifice. there's no realistic scenario where they can drive the PLA back into the ocean, but they can make it hurt so much that it forever hamper China's economic/political advances.
Couple of issues.
There are no telecoms out of Taiwan, except for some satellite comms.
There is no electricity, fuel or food imports either. Plus the transport network will have been crippled. So no food distribution or effective military mobilisation etc etc
So I give it a few weeks until Taiwan's society undergoes a complete collapse from hunger.
The Chinese Air Force can take out all the power plants, oil refineries, oil depots plus 300-odd bridges on major rivers/canals to separate Taiwan into 15 regions of 1-2 million people each.