About bale react after static resource loading the wrong question

Before the discovery of some of the issues in the package react projects, after packing up part of my png icon load does not come out, developer mode found their path somehow mixed I use <Browserrouter> route name in the react-router route, look online One method is to use Hashrouter, but some of my so this feature does not allow the natural way does not work, but I found another question, why is the same png image that few get out, I went into developer mode in addition to those found all showed normal png image is converted into base64, so the question is loaded static resources do not exist, why not put a few error also convert them into base64 yet. This time I found the build files packaged react folder, static folder has a media folder

Inside I found a picture of all the display is not normal, then find all the pictures are not displayed correctly in the folder path in the manner of loading, but because <Browserrouter> some unknown reason, and in fact lead to they can not load properly. These pictures have in common is the normal volume is relatively large display png image size, there are tens of K, then it was found that it is webpack configuration rules at the time of packaging, to find the path of the project folder directory node_modules

 

 

Change the figures highlight the file

 

 Appropriate to increase the limit value to convert the picture without a problem as there is a path base64

Guess you like

Origin www.cnblogs.com/zxh2459917510/p/11241256.html