How to make Create React App subfolder of public autoload?

Viewed 20

I setup react project by create-react-app and I found that the subfolder of react won't able to autoload when I create a new file, eg

<!-- file: /public/subfolder/index.html -->
<p>subfolder content here</p>

anyone knows how? According to the official react doc, it looks like react doesn't allow this kind pattern? Anyone knows more content?

1 Answers

This is not actually a restriction from React itself. That was how Webpack has configured in create-react-app. Please look at the below code snippet of a typical Webpack config file in a React application. If we need more custom configuration, we have to manually configure Webpack and Babel as per our requirements.

enter image description here

Link for the documentation: The best webpack configurations for React applications

Related