Create-react-app build release issu

when using create-react-app build to publish the official version, a large number of js files appear in the staic/js/ directory. What is the role of these js files? should there be only one main.js? can these js be optimized
clipboard.png

?
Sep.30,2021

you must have done demand loading, which is why there are so many js . I remember react-loadable can do this function. If there are many businesses, the resulting single js is very large. You can use this to split the code and load on demand

.

.map is mapsource can be understood as a mapping file. If you have these files, you can see the source code while debugging, otherwise you can only see the compressed files. If you want others not to see the source code after launching, you can delete these .map files

.

you obviously use demand loading, and you haven't named chunk yet, so it's easy to locate by adding your own name.

react-loadable, react-router and many others support on-demand loading. If you need to check it according to your own situation, it is strongly recommended to take a look at the document, and then give
chunk a name

.
Menu