4

I am trying to create a website and it uses some files like a folder with images, I have saved these images folder in my public directory of project, it works fine on localhost, but when I try to deploy it with production setting, it cannot access those subfolders of public directory.

The issue here is that when a project is build the files of public directory is sent to _next/static/media directory but the subfolders of public directory are not added. How can I add my subfolders of public directory to media directory so I can access images in it using src='subfolder/image.png'

I tried some next js config settings, or importing the folder using import but non worked. I want my subfolders to be added into media folder after build. I don't want to use import for each file of folder.

0 Answers0