Melt the butter and sugar in a frying pan with 50ml of water over a low heat. Once the sugar has dissolved, bubble until it turns a light brown caramel colour. Take off the heat and splash in the vanilla.
Cut the top and bottom off the pineapple, then use a small serrated knife to cut away the skin. You’ll need 6 round, individual tart tins, and the pineapple slices will need to sit in the base of these, so trim as much flesh from the sides as you need to. Slice the pineapple into 6 x 1.5cm thick rounds, then use a small round cutter to cut a hole from the centre of each, the size of a star anise.
Spoon the caramel between the 6 tins. If it’s gotten too thick, just re-warm a little – and don’t worry, as the pineapple cooks, it’s juices will loosen the sauce. Push a star anise into the hole of each pineapple slice. Cut out circles of the pastry a little larger than each pineapple ring, and lay them over each one, tucking the edges down around the fruit. Pop in the fridge to chill for 20-30 minutes.
Preheat the oven to 200°C (180°C fan oven) Gas Mark 6. Sit the tins on a baking tray, then bake in the oven for 18-20 minutes until the pastry is puffed and golden.
Carefully turn the tatins straight out onto serving plates. Enjoy with ice cream or crème fraîche.