Preheat your oven to 350°F. Grease a 9-inch round cake pan or line it with parchment paper.
In a mixing bowl, combine the flour, granulated sugar, baking powder, and salt. Add the softened butter, egg, and vanilla extract. Mix until a dough forms.
Press the dough evenly into the bottom of the prepared cake pan.
In another bowl, beat the cream cheese until smooth. Add the powdered sugar, crushed pineapple, and coconut extract. Mix until well combined.
Spread the cream cheese mixture over the dough in the pan.
Sprinkle shredded coconut on top if desired.
Bake for 25-30 minutes, or until the edges are golden and the center is set.
Allow to cool in the pan for 10 minutes, then transfer to a wire rack to cool completely.
Cut into wedges and serve.