Vascular patterning is critical for organ function. In the eye, there is simultaneous regression of embryonic hyaloid vasculature (important to clear the optical path) and formation of the retinal vasculature (important for the high metabolic demands of retinal neurons). These events occur postnatally in the mouse. Here we have identified a light-response pathway that regulates both processes. We show that when mice are mutated in the gene (Opn4) for the atypical opsin melanopsin, or are dark-reared from late gestation, the hyaloid vessels are persistent at 8 days post-partum and the retinal vasculature overgrows. We provide evidence that these vascular anomalies are explained by a light-response pathway that suppresses retinal neuron number, limits hypoxia and, as a consequence, holds local expression of vascular endothelial growth factor (VEGFA) in check. We also show that the light response for this pathway occurs in late gestation at about embryonic day 16 and requires the photopigment in the fetus and not the mother. Measurements show that visceral cavity photon flux is probably sufficient to activate melanopsin-expressing retinal ganglion cells in the mouse fetus. These data thus show that light--the stimulus for function of the mature eye--is also critical in preparing the eye for vision by regulating retinal neuron number and initiating a series of events that ultimately pattern the ocular blood vessels.