This is react + electron + webpack + typescript + swc template project. If you wan't this project, clone project and then just run!
npx degit raravel/react-electron-typescript <Your Project>
git clone https://github.com/raravel/react-electron-template.git <Your Project>
yarn dev
yarn build
.
├── LICENSE
├── README.md
├── package.json
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── main
│ │ └── background.ts
│ └── views
│ ├── App.tsx
│ ├── Components
│ │ ├── About.tsx
│ │ └── Home.tsx
│ └── index.tsx
├── swc.electron.json
├── tsconfig.json
└── webpack.config.js
Is directory for raw html, script, assets etc.
For electron background worker. background.ts
is like main.js
You can manipulating react component in src/views
.
webpack.react.config.js
. building src/views
contents to dist
and run electron process before react webpack dev server.
If you run npm run dev
, running process react webpack dev server. and then, running electron process on nodemon.
I think it is an efficient way to partially operational hot reload.
And by using swc, the build time of typescript is shortened.