DEV Community

Cover image for How to create an electron-forge project with React, Typescript and HMR

How to create an electron-forge project with React, Typescript and HMR

Raphaël Badia on June 14, 2020

introduction This post has been transferred to my blog. You can read the latest version here: How to create an electron-forge project...
Collapse
 
matheusgrieger profile image
Matheus Grieger

Thank you so much, this is very helpful!
However, do you have any idea how to use images and static assets (like fonts) in the app? Trying to import them just doesn't work, and I can't seem to get copy-webpack-plugin to work either.

Collapse
 
thyenigmatic profile image
Kapil Bastola

Thanks for the setup walkthrough. As I followed your steps, I encountered error when adding line:
import App from './App';

and the error was :
Unable to resolve path to module './App' .(import/no-unresolved).

After some digging and googling I found the solution here: stackoverflow.com/questions/598258...

adding :


'settings': {
'import/resolver': {
'typescript': {},
},
},


to .eslintrc.json worked.

Collapse
 
ipetrik profile image
IPetrik

Very helpful! I have not been able to get hot reloading to work, however. You say to use .babelrc, but in my hands the webpack-typescript template uses 'ts-loader' not 'babel-loader' by default. Even after changing the loader, however, I have not been able to get this to work.

Collapse
 
gist32091948 profile image
gist

that was nice walkthrough

Collapse
 
manen profile image
manen

Thanks for the tutorial!

Collapse
 
kabrau profile image
Marcelo Cabral Ghilardi

Tks !!!!

Collapse
 
focuscookie profile image
Stephan Lüddemann

Thanks for the walkthrough.

At the step with the entryPoints, it is not in the package.json - it is in the forge.config.ts

Collapse
 
truongluu profile image
Lưu Xuân Trường

This was a helpful walkthrough, many thanks

Collapse
 
matrixcloud profile image
atom

Very helpful! Many thanks.

Collapse
 
shadab19it profile image
Shadab Alam

Thank you working fine

Collapse
 
larsolt profile image
Lars

Works great, ty

Collapse
 
moai196 profile image
1.96m

Excellent! Thanks