Working on an Electron app with React. Right now, to get things started, I run the typical npm start
command which runs the react-scripts start
script.
This starts the dev server. Once the dev server is started, I open a second terminal window and run a script to start electron npm run start-electron
which opens my React app in the Electron window.
This works as expected, but I was curious if there was a way to create a script that would:
- Start the dev server
- Wait for dev server to be started
- Then start electron
I tried setting up a sequential script in package.json but it only starts up the dev server. For example npm run start && npm run start-electron
.
This isn't make or break. The two terminal option works fine, just didn't know if this was possible.