1. In a large dutch oven over medium heat, melt butter.
2. Add onions and a generous pinch of salt. Cook for about 10 minutes then add another pinch of salt and a pinch of sugar. Continue cooking and stirring occasionally for approximately 40-50 minutes until onions are caramelized. Be careful not to burn – they should be golden brown.
3. Once onions are caramelized, add flour and cook for 2-3 minutes. Then add wine to deglaze and bring to a simmer making sure to lift any browned bits off the bottom of the pot. Let cook for 1-2 minutes to allow the mixture to thicken.
4. Add broth, thyme, bay leaves, salt and pepper and stir to combine. Bring to a simmer and let cook for 20 minutes. Be sure to remove bay leaves and thyme stems.
5. Meanwhile, preheat the oven to 375 degrees. Brush baguette slices with olive oil and bake for 8-10 minutes then set aside.
6. Preheat the broiler and transfer soup into ramekins or small bowls and top with a layer of gruyere, 2 pieces of the toasted baguette, and another generous layer of gruyere.
7. Broil for 2-3 minutes until bubbling and golden brown.
Note – you don’t have to toast the bread ahead of time but I like to because it doesn’t break down as easily in the hot soup!