With regards whole ship replication, there are notes in the Next Generation Technical Manual .
It states that replication of an entire ship would take too many resources/too much energy.
The behind-screen notes say this is for dramatic effect as the viewer would care too little for the fate of the ship if they can just replicate a new one in minutes.
From Construction Chronology (P17):
Given the existence of matter replication devices (like the show's "food replicator" terminals), a very logical question is: "Why can't they just replicate entire starships?
" The real reason is that such an ability would allow us to create entire fleets of starships at the touch of a button.
This might be great for Federation defense and science programs, but makes for poor drama.
For this reason, starship construction facilities (seen at Utopia Planitia in "Booby Trap" and Earth Station McKinley "Family") have been depicted as construction platforms rather than large replicators.
We assume that replication is practical for relatively small items, but that energy costs would be prohibitive for routine replication of larger objects.
(Jon Singer points out that if you could make a starship at the push of a button, you wouldn't need to....)
scifi.stackexchange.com/users/3460/The Wandering Dev Manager
I would think that the cost/resources needed to make a replicator that size would take so long that it wouldn't be feasible.
I would think that it would be more cost effective to have small replicators to replicate all the parts, then have people or machines build the ships.
This would also give people jobs which would help with the whole 'perfect utopia' of Earth that Star Trek was trying to create.
scifi.stackexchange.com/users/1109/OghmaOsiris
I think that they do, at least they replicate the majority of the components and assemble them by hand.
Star Trek:
Enterprise foreshadowed the eventual use of replicators in the Dead Stop , where an automated repair station not only have the ability of replicating food but also ship components on-the-fly.
It stands to reason that replicators are how crews are able to repair massive damage to their vessels without the need to drydock.
Smaller replicators make much more sense than larger, ship-producing ones given their versatility: you can make components, useful for both construction and repair.
Plus there could also be a relation to the amount of energy and resources needed according to the size of the replicator.
In other universes, for example Stargate SG-1, the power requirements for the Stargate go up exponentially the larger the ring gets.
The same could be true in Star Trek: the larger the replicator, the greater the power draw to the point of being beyond diminishing returns.
scifi.stackexchange.com/users/2443/Chad Levy
There are industrial replicators , ostensibly used for mass production of components, but not anything as large as a starship.
Replication requires a lot of energy (as evidenced by the rationing of their use on the USS Voyager ) and it is very likely that assembly of components is more feasible than replicating a finished product.
scifi.stackexchange.com/users/3247/HNL
For the same reason that they still farm and mine minerals.
Storage is at a premium on a starship, so there is nowhere near enough room to store months and months of food for hundreds or thousands of people.
Therefore, there is an advantage to replicate food
so you don't have to carry it, even though a single apple might require many times as much energy to "build" out of subatomic particles as it takes to grow.
The benefits outweigh the costs for space travel, but if it takes a billion units of energy to construct a starship out of mined materials, it might take a quintillion units of energy to entirely replicate one.
Similarly, they can replicate critical parts onboard rather than having thousands of parts prebuilt, stored onboard, and waiting, or finding, retrieving, processing, and fabricating the parts.
So the advantage is that a unit the size of a refrigerator takes the place of a dozen farms, a kitchen, a mine, a foundry, a factory, a tailor, and countless other facilities, with the expense of consuming a huge amount of energy.
The fact of the matter is that without one, the ships would need to come back to port every month, or be met wherever they were by a resupply ship, periodically, which would badly impair their ability to explore.
scifi.stackexchange.com/users/12695/Jordan
The replicators work very similarly to how the transporter works.
It is to put it simply a matter energy converter.
It takes energy from the ship which is fueled by deuterium then converts it into matter.
The size of the replicators adds to the power draw along side the energy required to be converted into matter.this means that large replicators would not be as efficient as several smaller ones.
On top of this the replication of smaller parts allows for more room for error because if there is a defect instead of Dematierializing a large object and thus using more energy, they can dematierialize a small object and expend less.on top of all this if it is put together by people or machines
it gives error control meaning that instead of the whole ship being faulty.
Its just one piece which a builder can spot, identify and get rid of.
scifi.stackexchange.com/users/25878/Josh Moore
There is also the fact that SF is not a military organization intent on conquest so mass production is not a Necessity instead focus is put on innovation and improvements for each new ship which is something that requires finesse and precision changes not to mention R&D etc.
this is why you never see two ships that look 100% the same!
scifi.stackexchange.com/users/92969/Anonymous
In Star Trek, it seems like they take forever to build ships.  It takes months, if not years to make them.  So why not just build gigantic replicators in space, then replicate the ship (excepting non-replicatable objects like the warp core)?  This would presumably come with a huge energy cost, but would save massive amounts of time.
Why don't they just replicate ships instead of build them?
scifi.stackexchange.com
<star-trek>
scifi.stackexchange.com/questions/7035
scifi.stackexchange.com/users/None/
Replication of an entire ship would take too many resources/too much energy.  The benefits outweigh the costs for space travel, but if it takes a billion units of energy to construct a starship out of mined materials, it might take a quintillion units of energy to entirely replicate one. In addition, the viewer would care too little for the fate of the ship if they can just replicate a new one in minutes. In universe it would cost too many resources to replicate a large ship so it is not fesable. Behind the scenes it has been states that this has also been done to make the audience care more about the ship.
In-universe it has been stated that it would take too many resources to replicate.  Behind the scenes it was states that it is to make the audience care more about what happens to the ship.