I have a related question. If a shuttle gets destroyed do they just replicate another one? Or do they actually have to build it? Now that I think about it, couldn't they just build a really big replicator and pump out galaxy class starships?
I doubt they can just "replicate" entire starships. That's stretching the technology a bit too far. We could probably argue there's quantum-level details in starship building that's critical and since replicators only work on an atomic level they can't be replicated. Certain parts and materials, sure, but not the entire thing.
It could also be a "cost" thing, the amount of energy it'd take to replicate an entire starship exceeds the energy it takes to simply mine certain materials, smelt them into alloys and to have workers build it from scratch. Again, it's one thing to replicate certain parts and materials, it's another to replicate tons of a common metal you can just harvest from an asteroid or something at half the energy cost.
Along the same lines I doubt they can just "replicate' shuttles again coming back to a quantum-level complexity that would be lost in the replication process or a cost-benefit situation. It's not worth replicating an entire shuttle when you can just go to a starbase and pick one up at no energy cost. (Energy better spent for other things like food, propulsion, etc.)
Energy is very, very plentiful in the Federation but it's not infinite and still "costs" something to make. Either in dilithium or in antimatter (which must either be harvested/collected or produced in some manner.)