Reputation: 13192
In all the articles that explain how to use create-react-app with electron (eg : https://www.codementor.io/randyfindley/how-to-build-an-electron-app-using-create-react-app-and-electron-builder-ss1k0sfer ) , they mention that electron.js file should be placed within public
folder.
I want to have typescript definitions for this electron.js too (since i am using typescript for the react app also). How do I do this ?
Upvotes: 0
Views: 596
Reputation: 2051
I have spent quite a bit of time working on an electron project as well as creating a starter kit for using Electron + TypeScript (very strict) + Create React App (non-ejected). I think you might find it useful as a starting point, even though there might be some additional tooling that you might not need.
Check out the electron branch of Foldable for more details. Of particular interest would be src/electron.ts, package.json and the public dir.
To quickly give you some additional points that might be useful in your question:
package.json
under "main"Upvotes: 2