Cut the onion into small cubes and then grate the Gouda.
Cook the spaetzle for about 3 minutes according to the instructions on the packet.
Meanwhile fry the onion cubes with the bacon cubes in oil and season with salt and pepper.
Preheat the oven to 180 ° C top / bottom heat.
Drain the finished spaetzle and spread some of the spaetzle in a baking dish. Spread part of the onion and bacon mixture over the top. Continue until all the spaetzle and the onion and bacon mixture are used up. Sprinkle the spaetzle mixture with the Gouda.
For gratinating, place the casserole dish on the middle rack in the oven until the cheese is golden brown.
In the meantime, halve or quarter the tomatoes and chop the basil a little.
Place the tomatoes and basil on the baked spaetzle and serve.