Gather all ingredients. Preheat the oven to 350 degrees F (175 degrees C). Grease a 9x13-baking dish with cooking spray.
Mix flour, white sugar, baking soda, and salt in a large bowl and make a well in the center.
Add eggs, crushed pineapple with juice, and vanilla; whisk until well-combined.
Pour into the prepared baking dish.
Bake in the preheated oven until top is deeply browned and a toothpick inserted into the center of the cake comes out clean, about 35 minutes. Let cake cool in the dish on a wire rack, 1 to 2 hours.
To make the frosting: Combine cream cheese and butter for frosting in a mixing bowl; beat with an electric mixer until smooth, about 1 minute.
Add confectioners' sugar and vanilla; beat until creamy, about 1 or 2 minutes more.
Spread frosting on cooled cake.
Serve and enjoy!
