I was trying to upload my ReactJS Project on cPanel and after running “npm run build” it created a “dist” folder, i noticed that my image files weren’t on the generated assets folder nor appearing with the “npm run preview”.
The generated dist folder had an assets folder with my favicon, a js config file and a css file. the issue is that the fav icon was on my assets folder with the other images that weren’t added to the build. the only difference is the .ico was linked on my index.html.
structure of my project on vscode
the generated dist folder
my first thought was to change de path of the images, but it didnt resolve the issue. i also have opened the network dev tools to see if there was any error loading, but the name of the image files appear with 200 code.
after looking up more about vite, i tried to apply “assetsDir: ‘path’,” on the vite.config.js, but it also didnt work.
the npm run preview shows the fav icon and currently on the homepage the only thing missing is the images, it just has the alt atributte with the images description.
Joao Hugo Leda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.