This study evaluated the impacts of replacing fish meal (FM) with defatted black soldier fly (Hermetia illucens; BSF) on the growth performance, flesh quality and transcriptome of Pacific white shrimp (Litopenaeus vannamei). In a diet containing 560 g/kg FM, BSF was used to replace 0%, 20%, 40%, 60%, 80% and 100% of dietary FM (BSF0, BSF20, BSF40, BSF60, BSF80 and BSF100). Thus, six isonitrogenous and isolipidic diets were prepared, and then fed to juvenile Pacific white shrimp (1.70 +/- 0.10 g) for 60 days. In growth performance, the BSF20 group showed the similar FCR and WGR to the control group (P > 0.05), and the other four BSF groups presented significantly lower WGR and higher FCR than the BSF0 group (P < 0.05). The flesh chewiness and the contents of crude lipid, collagen and total amino acid in flesh were significantly decreased (P < 0.05), and flesh cooking loss, thawing loss was significantly increased when the replaced FM was >= 40% (P < 0.05). When the replaced FM reached 60%, the flesh hardness, heat-insoluble collagen content, shear force, body surface redness and the ratio of n-3/n-6 fatty acids were significantly lower (P < 0.05), while n-6 polyunsaturated fatty acid content and total free amino acid content in flesh were significantly higher than those of the BSF0 group (P < 0.05). Hepopancreatic samples were used for transcriptomic analysis, and a total of 1,456 differentially expressed genes (DEGs) were identified between the BSF groups and BSF0 group, which were mainly involved in growth-promoting, energy metabolism and antioxidant capacity key pathways and genes, including the cathepsin L, folate synthesis pathway, redox-related genes and glutathione metabolism pathway. In conclusion, in a diet containing 560 g/kg FM, BSF could successfully replace 20% of dietary FM, and higher FM replacement (>= 40%) decreased the growth performance and flesh quality of Pacific white shrimp.