Preheat oven to 350 degrees. Spray 2 round cake pans with non-stick spray. Set aside. In a bowl, mix together canned pineapple, vanilla cake mix, and coconut extract. Stir until batter is smooth. Divide batter between the two cake pans. Bake according to package directions, or until toothpick comes out clean.
Meanwhile, whisk together pudding mix , coconut extract, and milk in a medium bowl until there are no lumps left. (Note: Start with milk in the bowl, and gradually add pudding mix while whisking continuously to avoid lumps forming in the pudding)Fold in cool whip. Refrigerate frosting until ready to frost cakes.
When cakes are completely cooled, frost cake, one layer at a time. Place each layer on top of each other, and sprinkle with shredded coconut if desired.