"This recipe is perfect for those heart-shaped baking pans you always see in the Valentine section of the supermarket or discount department store. The amount of batter is roughly half of the normal bar cookie recipes. Pink, red, and white M&M's® make it sweetheart-special, but you can always use regular M&M's® or your favorite chocolate chips. Wrap the cooled cookie in plastic or return to pan for serving."
Trace the bottom of a heart-shaped aluminum pan over parchment paper; cut along the tracing. Spray pan lightly with cooking spray and line with the heart-shaped paper.
Preheat oven to 325 degrees F (165 degrees C).
Combine butter, white sugar, and brown sugar in the bowl of a stand mixer fitted with the paddle attachment; beat until smooth and creamy. Add egg and vanilla; mix until batter is blended, about 50 strokes.
Whisk flour, salt, and baking soda together in a small bowl. Add flour mixture into the batter; stir until thick but spreadable, about 100 strokes. Fold in milk chocolate pieces gently. Pour batter into the prepared pan; spread evenly with a spatula, leaving a 1-inch margin from the sides.
Bake in the middle shelf of the preheated oven until edges are golden brown and middle is set, 18 to 23 minutes. Press any remaining milk chocolate pieces into the still-warm cookie for decoration.
Let cool in pan for 10 to 15 minutes; transfer to a cooling rack and remove the parchment paper.