I have built my react js app with create-react-app configs and it works fine in development build of React.
I built that with npm build command and now i have build folder.
this web page is static (server-less), Now I want to know how to use that and where put files in Cpanel.
2
Answers
After the bundle realized by
webpack
, you can check the transpiled and minified version inside thebuild
folder. You should upload all the content to yourpublic_html
or another folder.And the meaning of server-less is totally different than you’re using. Check this article to understand what it is: What is serverless.
I do not use CRA boilerplate since i have my own but in your case, you should find where your js bundle is. You can find the bundle location in the webpack config. Then append that to your html somehow like this:
Assuming that somewhere in your code, you are appending your js code into a div like this:
That works if its just simple react project your working on (No SSR and such)