Heat the oven to 350°F and coat a 9-by-13-inch baking dish with cooking spray.
Scatter the brioche cubes and drained pineapple evenly in the dish.
Whisk the eggs, milk, sugar, vanilla and salt in a large measuring cup and pour the custard over the bread.
Press the bread beneath the custard, let it stand for 10 minutes and scatter the coconut over the top.
Bake uncovered for 45 to 50 minutes, until the center reaches 160°F, looks set and the coconut is toasted brown at the tips.
Rest for 15 minutes before serving so the custard firms around the fruit.