React on-demand loading packaging problem

use create-react-app development project to use react-loadable to load routes on demand
when build packages the project, it will pack all the files on demand so that there will be a problem
for example, I have a lot of pictures, then each picture will be loaded on demand to generate a js file. 100picture will generate 100js
how to solve this problem?

Oct.04,2021

react-loadable is loaded on demand based on routes, and how many routes generate how many js, has nothing to do with the picture

Menu