npm run build
I build a simple react app; this is what I see in build/ folder
jdoe@AIR ~/Sites/react/alphabets/build main ± tree
.
├── asset-manifest.json
├── favicon.png
├── index.html
└── static
├── css
│ ├── main.f05a5dc1.css
│ └── main.f05a5dc1.css.map
└── js
├── main.cec1e2e8.js
├── main.cec1e2e8.js.LICENSE.txt
└── main.cec1e2e8.js.map
4 directories, 8 files
Since
I also have a Laravel site that I deployed.
I thought I could drop it in my `public/ and navigate to it like so.
https://www.bunlongheng.com/react/alphabets/
I tried SCP my build/ it to public/react/alphabets/build in my server.
When I go to it, I see no error, no forbidden, but a white screen.
I need a way to deploy react projects as simply as possible since my goal is to deploy more than one... ex.
mysite/react/first-project
mysite/react/second-project
mysite/react/third-project
mysite/react/forth-project
and so on...
& leave my main site as it...
Any hints for me ? I know I am close.
Your title said as subdomain, but your example URLs are subdirectory/subfolder. So I assume you meant how to build react app as subdirectory.
the blank page mean the resource is not loaded because the resource path is using root path(
/). To change the base path, you just need to addbasenameto your router :and also you need to add
homepageto package.json. example:or another way you need to move/copy
public/react/alphabets/build/statictopublic/static/