In a small saucepan, add the oil, onion, 1/2 teaspoon sugar, and 1/2 teaspoon salt over low heat. Stir occasionally, and cook for three or five minutes on medium heat, until the onion is evenly golden brown.
Adding the chilli flakes, sesame seeds, and Sichuan peppercorns, if using, and stir for a minute. Then, add the remaining 1/2 teaspoon sugar and 1 teaspoon salt. Use immediately or store in the refrigerator for up to 2 weeks.