A detection of the environmental dependence of the sizes and stellar haloes of massive central galaxies