Skip to content
Ludwig Richter edited this page Dec 27, 2021 · 2 revisions

Frequently asked questions

Here are some questions and answers that are helpful to know when you use the React Electron boilerplate and edit or adjust it to your needs.

electron-builder warning: public/electron.js not found

Electron-builder detects React and React-like dependencies in your project and a warns you every time you use it that you please add a electron.js file in the public folder.

But the boilerplate also uses Typescript for the main process script of electron, so it needs compiled down to javascript into the build folder next to the react build. So, there are two Typescript configurations, one for react-scripts and one for the main process.

We cannot build into the public because on every change in the main folder (where the source code of the main process script resides) the output changes and must be commited to be up-to-date with the source-code. This is error prone and not recommended.

So please ignore the message, electron-builder will package with this warning, too.

Two Typescript configurations

Why there are two Typescript configuration files?

The first one named tsconfig.json is for react-scripts and their build scripts. So if you want to change something regarding to the build process of the React app running inside the electron app, edit this file.

The second file named tsconfig.main.json is only for the build step of the main process script of electron. If you want additional features from Typescript for the source code of the main script, edit this file.

Navigation

Using the badge

If you use this boilerplate, please consider using its badge in your README.md:

Built using electron react boilerplate

Using

[![Built using electron react boilerplate](https://img.shields.io/static/v1?label=Built%20using&message=electron-react-boilerplate&labelColor=2B2E3A&color=61DAFB)](https://github.com/fliegwerk/electron-react-boilerplate)

in your README.md file.

Clone this wiki locally