The association between vitamin D and wheezing in early childhood is unclear. The primary objective of this study was to evaluate the association between vitamin D exposure, during both pregnancy and childhood, and early childhood wheezing. Secondary objectives were to evaluate the associations between vitamin D exposures and asthma and wheezing severity. We conducted a cohort study of children (0–5 years) recruited from 2008 to 2013 through the TARGet Kids! primary-care research network. Vitamin D exposures included maternal vitamin D supplement use during pregnancy, child vitamin D supplementation and children’s 25-hydroxyvitamin D (25(OH)D) concentrations. The outcomes measured were parent-reported childhood wheezing, diagnosed asthma and wheezing severity. Vitamin D supplement and wheezing data were available for 2478 children, and blood samples were available for 1275 children. Adjusted odds ratios (aOR) were estimated using logistic regression adjusted for age, sex, ethnicity, body mass index, birth weight, outdoor play, breastfeeding duration, daycare status, parental smoking and family history of asthma. Vitamin D supplementation during pregnancy was associated with lower odds of childhood wheezing (aOR=0.65; 95% CI: 0.46–0.93). In early childhood, neither 25(OH)D (aOR per 10 nmol/l=1.01; 95% CI: 0.96–1.06) nor vitamin D supplementation (aOR=1.00; 95% CI: 0.81–1.23) was associated with wheezing. No significant associations were observed with diagnosed asthma or wheezing severity. Vitamin D supplementation during pregnancy was associated with reduced odds of wheezing, but child vitamin D supplementation and childhood 25(OH)D were not associated with reduced wheezing. The timing of exposure may be important in understanding the association between vitamin D and childhood wheezing.