Remove the heads and guts from the anchovies and wash them thoroughly.
Thinly slice the onion and chili pepper.
Heat cooking oil in a pan and stir-fry the anchovies until golden brown.
Add water, soy sauce, sugar, minced garlic, and chili pepper, then bring to a boil.
Simmer over medium-low heat until the sauce is slightly reduced.
Add the onion, bring to a boil once more, then finish.