Melt-polymerization and mechanical ball-milling were combined to achieve the facile mass production of polyimide covalent organic frameworks (COFs) towards high-performance sodium-ion batteries. The as-obtained COFs were demonstrated with high utilization of active sites (>83.0%) and COFs with smaller pore sizes were proved to deliver better performance with a specific capacity of 213.7 mA h g-1 at a current density of 0.1 A g-1.