- 2 cups all-purpose flour
- 2 cups white sugar
- 1 (20 ounce) can crushed pineapple, undrained
- 1 teaspoon baking soda
- 2 eggs
- 1 cup shredded coconut (optional)
- 1 cup chopped walnuts (optional)
- 1/2 cup butter, room temperature
- 1 (8 ounce) package cream cheese, room temperature
- 1 (16 ounce) package confectioners' sugar
- 1 teaspoon vanilla extract
- 1/2 cup chopped walnuts, or to taste (optional)
- 1/2 cup shredded coconut, or to taste (optional)
- Preheat oven to 350 degrees F (175 degrees C). Grease and place a layer of waxed paper in a 9×13-inch baking pan. Butter and flour the waxed paper layer.
- Mix flour, white sugar, pineapple, baking soda, eggs, 1 cup coconut, and 1 cup walnuts together in a bowl. Pour batter into prepared baking pan.
- Bake in the preheated oven until cake is golden brown and a toothpick inserted in the center comes out clean, 40 to 45 minutes. Let cool for about 15 minutes in the pan; run a knife around the edge of the cake to loosen from pan. Flip onto cooling rack.
- Whip butter, cream cheese, confectioners' sugar, and vanilla extract together in a bowl until light and creamy. Frost the cooled cake. Top with about 1/2 cup chopped walnuts and 1/2 cup shredded coconut.