Dry the tofu with paper towel, then wrap it in a kitchen towel and place it between two plates. Put 2 cans on top and leave it for 15 minutes.
Meanwhile, peel the squash and dice it into 2- cm pieces. Peel the ginger, then thinly slice.
When the tofu is dry, cut it into 2-cm cubes.
Heat the oil in a wok, then fry the tofu pieces until golden brown all over, then transfer them to a plate, lined with paper towels. This should take about 10 minutes.
Turn the heat down and gently fry the squash pieces until tender and golden.
Put the tofu pieces back, add the ginger, anise, sugar and soy sauce. Pour in the water and bring it to the boil, then gently simmer for 15 minutes, stirring through occasionally.
When the sauce is thick and syrupy, the squash is soft (but not falling apart), turn off the heat and carefully stir in the spinach.
Serve with chilli slices scattered on the top.