Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing public folder but this is how you can create a public folder? #261

Open
officialdrafty opened this issue Dec 17, 2022 · 0 comments

Comments

@officialdrafty
Copy link

In a React project, the public folder typically contains assets such as your favicon, manifest file, and other files that are served directly by the web server without being processed by the React app. If your project does not have a public folder, you can create one by following these steps:

  1. In your project root directory, create a new folder called public.
  2. Add any assets that you want to serve directly to the public folder.
  3. In your React app, you can reference these assets using the %PUBLIC_URL% placeholder. For example, if you have a file called favicon.ico in your public folder, you can reference it in your HTML file like this: .

If you are using create-react-app to set up your project, the public folder is already set up for you and you can add your assets to it directly. If you are not using create-react-app, you will need to configure your build process to copy the contents of the public folder to the build output directory. This can typically be done using a tool like cp or rsync. You can also use a build tool like Webpack to automate this process as part of your build pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant