Preheat the oven to 350°F. Line a 9-inch loaf pan with parchment paper.
In a large mixing bowl, whisk together the flour, granulated sugar, baking powder, baking soda, cinnamon, nutmeg, and salt. Set aside.
In a separate large bowl, whisk the melted butter and brown sugar until smooth.
Add the eggs one at a time, whisking well after each addition.
Stir in the crushed pineapple (with its liquid) and vanilla extract until fully combined.
Stir in the mashed bananas until evenly incorporated.
Gently stir the dry ingredients by hand into the wet mixture just until no streaks of flour remain. Be careful not to over mix.
Fold in the walnuts or pecans, if using.
Pour the batter into the prepared loaf pan and spread it evenly. Bake for 60 to 70 minutes, or until a toothpick or skewer inserted into the center comes out clean.
Remove from the oven and place the pan on a wire rack. Allow the bread to cool completely before removing it from the pan, slicing, and serving.