Preheat the oven to 350 degrees Fahrenheit.
In a bowl, mix the almond milk and vinegar and set aside for a few minutes until it curdles.
Add the sugar, oil, vanilla extract and beat togeter until it turns frothy.
In another bowl, sift together the flour, baking soda, baking powder, cocoa powder, coffee granules if using, and salt.
Add the cocoa-flour mixture to the wet ingredients in two batches, mixing well until the mixture is fairly smooth. Don't overbeat. A few small lumps are fine.
Line a cupcake pan with paper liners. Pour the batter into each liner, about 3/4 full.
Bake in the preheated oven for 18 minutes or until a toothpick inserted in the center of a cupcake comes out clean.
Cool on a rack for about 10 minutes. Then unmold the cupcakes and place them on the rack to cool thoroughly before frosting..