Due to the improvements in radial velocity and transit techniques, we know that rocky or rocky-icy planets, in particular close-in super-Earths in compact configurations, are the most common ones around M dwarfs. On the other hand, thanks to the high angular resolution of ALMA we know that many disks around very low-mass stars (between 0.1 and 0.5 M$_ are rather compact and small (without observable substructures and radius less than 20 au), which favors the idea of an efficient radial drift that could enhance planet formation in the terrestrial zone. Our aim was to investigate the potential formation paths of the observed close-in rocky exoplanet population around M dwarfs, especially close-in super-Earths, assuming that planet formation could take place in compact disks with an efficient dust radial drift. We developed N-body simulations that include a sample of embryos growing by pebble accretion exposed to planet-disk interactions, star-planet tidal interactions, and general relativistic corrections that include the evolution of the luminosity, radius, and rotational period of the star. For a star of 0.1 M$_ we considered different gas disk viscosities and initial embryo distributions. We also explored planet formation by pebble accretion around stars of 0.3 M$_ and 0.5 M$_ Lastly, for each stellar mass, we ran simulations that include a sample of embryos growing by planetesimal accretion instead of pebble accretion. Our main result is that the sample of simulated planets that grow by pebble accretion in a gas disk with low viscosity ($ $) can reproduce the close-in low-mass exoplanet population around M dwarfs in terms of multiplicity, mass, and semi-major axis. Furthermore, we found that a gas disk with high viscosity ($ $), and thus lower pebble accretion rates, cannot reproduce the observed planet masses as no planet more massive than 0.5 M$_ could be formed in our simulations. In addition, we show that planetesimal accretion favors the formation of smaller planets than pebble accretion does. Whether this planet population truly exists remains unknown with the current instrumental sensitivity. Rocky planet formation around M dwarfs can take place in compact and small dust disks driven by an efficient radial drift in a gas disk with low viscosity ($ $). This result points toward a new approach in the direction of the disk conditions needed for rocky planet formation around very low-mass stars.