We study the production of loops in the cosmic string network in the expanding background by means of a numerical simulation exact in the flat-spacetime limit and first order in the expansion rate. We find an initial regime characterized by production of small loops at the scale of the initial correlation length, but later we see the emergence of a scaling regime of loop production. This qualitatively agrees with earlier expectations derived from the results of flat-spacetime simulations. In the final scaling regime we find that the characteristic length of loops scales as similar to 0.1t in both radiation and matter eras.