Preheat your oven to 400°F (200°C).
Chop the vegetables (bell peppers, zucchini, and cherry tomatoes) into bite-sized pieces. Place them on a roasting pan, drizzle with olive oil, and season with salt and pepper.
Roast the vegetables in the oven for about 20-25 minutes or until tender and slightly caramelized.
While the vegetables are roasting, cook the spaghetti according to the package instructions. Drain and set aside.
In a large mixing bowl, combine the cooked spaghetti with the roasted veggies and pesto sauce. Mix well to coat evenly.
Transfer the mixture to a baking dish and top with shredded mozzarella cheese.
Bake in the oven for 10-15 minutes, or until the cheese is melted and golden brown.
Remove from the oven and garnish with fresh basil, if desired. Serve hot.