In a small saucepan over medium low heat, place all the ingredients and mix to combine.
Cook for about 15 minutes, stirring occasionally, until the sugar has dissolved. If the sauce comes to a boil at any point, reduce the heat so that it remains at a low simmer.
Turn off the heat. Remove or strain the star anise, ginger, and peppercorns. You can opt to remove the garlic too if you'd like. The sauce will continue to thicken as it cools.
Leave the mixture to cool completely before storing in a jar and refrigerating. The sweet soy sauce will continue to thicken as it cools completely.
Store in an air-tight container and refrigerate until ready to use. This can be stored for months!
