Preheat oven to 350°F (175°C). Grease and flour a 9x13-inch baking pan.
In a large mixing bowl, combine flour, sugar, baking soda, and salt.
Add eggs, vanilla, and crushed pineapple with juice. Mix until well combined.
Stir in chopped pecans, if using. Pour batter into the prepared pan.
Bake for 30-35 minutes, or until a toothpick inserted in the center comes out clean.
While the cake is cooling, prepare the frosting. Beat cream cheese and butter until smooth.
Add powdered sugar and vanilla extract, mixing until creamy.
Spread frosting evenly over the cooled cake. Serve and enjoy!