Preheat oven to 350°F (175°C). Grease and flour a 9×13-inch baking dish or two 9-inch round cake pans.
Mix Dry Ingredients: In a large bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
Mix Wet Ingredients: In another bowl, whisk together the sugars, eggs, vegetable oil, and vanilla extract until smooth.
Add Pineapple & Carrots: Stir in the crushed pineapple (with juice) and shredded carrots.
Combine & Fold: Gradually mix the dry ingredients into the wet ingredients. Fold in the shredded coconut and nuts (if using).