I always went by Kirk's line in Squire of Gothos, that the ship could "manufacture" whatever they wanted, sounding a little more mechanical and physical in it's operation. The original E had high speed food preparation and movement, machine rooms that could build or create things at what we would consider incredible rates.
But the replicator of matter-energy transporter based operation seemed to awe and be new to everyone in TNG.
For some reason though neither were ever able to make Dilithium, one of those Trek "rules" that stuck.
I wrote a short 'evolution of warp technology' article a couple of years ago taking the "Lithium" line literally to mean nano-tube lithium "crystals" manufactured on the atomic level as an experimental subsitute to Dilithium that could also be machined on-ship if necessary but never worked out.