It’s common to find dishes like this on the table in Indonesia: somewhere between a chutney and side. Peceli can be served hot, room temperature or even cold, as a side to curries or roast or grilled meat.
Heat a pan on medium. Add oil, onion, garlic and chile. Sauté for 3 minutes.
Grind spices. Add to pan with sugar and sauté 1 minute, stirring constantly.
Add pineapple, salt and water. Stir and cook for around 15 minutes on medium heat.