Converting Existing React Application to Electron Desktop Application

Ahmad Mustafeen
2 min readOct 25, 2021

--

Assuming at the start, you already have a React Application in a working condition and you have already deployed that application somewhere like firebase or vercel or netlify.

Now Starting with Installations:

Install following packages:

1- “npm i electron-builder”

2- “npm i electron”

Edit your package.json file like the following:

setting the entry file

Add this at the beginning of the package.json file

add build and edit sc

add build and add the following scripts in “Scripts”

after adding the following packages your dev-dep should have these

Now inside the Public folder on the root , create an entry file for electron, we are naming it as Electron.js, you can name it as you like as far as you make sure it’s the same in package.json.

Paste the following code in electron.js

electron.js

Starting the development server:

Now we are all set to get started with electron

run the following commands
1- yarn start
2- yarn electron

Releasing the Production Build:

run the command

yarn dist
yarn dist-all (when on mac and want build of windows OS as well as MAC OS)

Completed.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Ahmad Mustafeen
Ahmad Mustafeen

Written by Ahmad Mustafeen

Software Engineer | Mobile Application | Frontend Developer

No responses yet

Write a response