Skip to content

amuammer/deploy-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deploy-react

install

npm install -g deploy-react

New feature 🔥 pm2 🔥

deploy-react with pm2:

image

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 👉 click 👈


New feature 🔥 Proxy 🔥

deploy-react with proxy in "production" :

image

setupProxy.js must be in the src folder ./src/setupProxy.js

setupProxy.js 👇 template
👉 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"
	}

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published