In a large, ovenproof skillet, heat the olive oil over medium heat. Add the onions and salt and pepper and cook until the onions are soft and golden, about 8 to 10 minutes. Add the tomato juice, wine, and vinegar and bring to a boil. Reduce the heat to low and simmer until the onions are tender and begin to separate, about 15 minutes.
Stir in the tomatoes and cook 5 minutes more. Stir in the basil. Transfer to a bowl and cover to keep warm. The compote will keep, tightly covered, in the refrigerator for 3 days.