Preheat your oven to 350°F (175°C). Grease a 9×13-inch baking dish.
Spread the diced pineapple evenly across the bottom of the baking dish.
Mix the dry ingredients: In a large bowl, whisk together the flour, sugar, baking powder, baking soda, and salt.
Combine wet ingredients: In a separate bowl, mix the applesauce, melted butter, and vanilla extract until well combined.
Pour the wet ingredients into the dry ingredients and stir until just combined. Be careful not to overmix.
Pour the batter over the pineapple in the baking dish, spreading it out evenly. If using shredded coconut, sprinkle it over the top of the batter.
Place the dish in the oven and bake for 45-50 minutes, or until a toothpick inserted into the centre comes out clean and the top is golden brown.
Allow the cake to cool for at least 10 minutes before serving. Top with whipped cream or a scoop of ice cream if desired.