1

I want to automate reactjs build process. So I created batch file contains series of commands like

cd react-project && npm i && npm run eject && npm run build && serve -s build

Everything works fine until it executes serve -s build it is supposed to keep running the command without closing cmd but it shutdown cmd without throwing an error

Revansiddh
  • 2,932
  • 3
  • 19
  • 33
  • The `eject` command must be run only once at project life. And [most probably](https://stackoverflow.com/questions/44114436/the-create-react-app-imports-restriction-outside-of-src-directory) you do not need to run it. – oklas Jun 28 '18 at 07:35
  • yes, I'm aware of that but in my case development code is not ejected. I copy that code in deployment and follow the same process again. That why I want to make the batch file and its execution should do my job – Revansiddh Jun 28 '18 at 08:22
  • What is `serve`? it's not a native Windows `cmd` command... – aschipfl Jun 28 '18 at 11:31
  • not serve is node enviroment command – Revansiddh Jun 28 '18 at 11:32

1 Answers1

1
call npm i
call npm run build
call serve -s build -l 4000
cmd /k