deploy-react
v2.2.11
Published
deploy build react folder files
Downloads
203
Maintainers
Readme
deploy-react
install
npm install -g deploy-react
New feature :fire: pm2 :fire:
deploy-react with pm2:
Now you can deploy your front end server with pm2 clustering and enjoy with all its amazing features
pm2 start -f --name front deploy-react -- -https -d dist -p 443
pass arguments to pm2 process
pm2 start deploy-react -- arg1 arg2 arg3
more about pm2 :point_right: click :point_left:
New feature :fire: Proxy :fire:
deploy-react with proxy in "production" :
setupProxy.js must be in the src folder ./src/setupProxy.js
setupProxy.js :point_down: template :point_right: http-proxy-middleware https://github.com/chimurai/http-proxy-middleware
deploy-react -d build -proxy
deploy current folder
cd react/app/build_folder
deploy-react .
deploy to specific directory
deploy-react -d specificDirectory
deploy to specific entry name
deploy-react -e entryName.html
deploy to specific port
deploy-react -p 8080
deploy with https
Note the next files must be exist in parent dir of the entry file
- -> build/index.html
- sslcert/server.key
- sslcert/server.crt
- sslcert/ca.crt // if you don't have create an empty file "touch ca.crt"
deploy-react -https .
Hint ,, you can write this scripts in package.json of react to get auto deploy
"scripts": {
"postinstall":"npm install -g deploy-react",
"start": "deploy-react -d build"
}