Slice onions as thin as possible, put them in a saucepan with peeled and minced ginger, bayleaves, black pepper, sugar and raisins.
Add wine, a drizzle of oil and a pinch of salt.
Put the saucepan on medium fire, cook for about 30 minutes mixing now and then, you should end with a thick and caramelized compote.
Remove bayleaves and let it cool, serve room temperature, you can keep it in the fridge for about 3-4 days.
If you want to can the compote pour it straight from fire into sterilized jars, close lids and put them upside down. Keep them upside down until cool.
If the lid still make sound when pressed put the jars in a cold water pan, all covered with water; bring it to a boil and boil until the lids make click no more.
Let them cool into the water.