DEV Community

loading...

Discussion on: Start a new Electron app with React and Typescript.

Collapse
thedavvy profile image
Davvy

Is it possible to start both react and electron with just one command?

Collapse
whitehatcip profile image
whiteHatCip

hi!
just add the concurrently npm package to the dev dependencies and your scripts should be like this:

"scripts": {
"dev": "concurrently --success first \"npm run dev:electron\" \"npm run dev:react\" -k",
"dev:electron": "cross-env NODE_ENV=development webpack --config webpack.electron.config.js --mode development && electron .",
"dev:react": "cross-env NODE_ENV=development webpack serve --config webpack.react.config.js --mode development && electron ."
},

As you can see, the dev script calls the concurrently command and the commands that you need to execute concurrently have to be put one after the other among quotation marks ("), escaping them, obviously.

Forem Open with the Forem app