1batch Homemade German Spätzle (about 5 cups cooked Spätzle, can use store-bought if preferred), can be made in advance and refrigerated until ready use, then let warm to room temperature before baking.
2very large onions, chopped
12ouncesshredded Emmentaler or Jarlsberg (Swiss-like from Norway, mild)(you can also add some Gruyere for extra flavor)
Preheat the oven to 400 degrees F. Butter a 9x13 (or a little smaller) casserole dish.
To make the caramelized onions: Melt the butter in a medium-sized heavy stock pot or Dutch oven. Add the onions and stir occasionally for 20-30 minutes until deeply caramelized. Halfway into it sprinkle with a little salt and sugar to help with the caramelizing. Get the onions nice and brown.
Layer 1/3 of the Spätzle in the bottom of the dish followed by 1/3 of the cheese and 1/3 of the caramelized onions. Repeat, sprinkling each layer with some salt, ending with cheese and onions on top.
Bake for 10 minutes or longer until the cheese is melted and the edges are just beginning to get a little crispy.Serve immediately. This makes great leftovers!