clean-electron-react
is an Electron boilerplate including a fresh setup of React, Typescript Prettier and Webpack in order to provide the cleanest possible setup experience.
Clone the repository or Use this template.
git clone https://github.com/matthiaaas/clean-electron-react.git YOUR-PROJECT-NAME
cd YOUR-PROJECT-NAME
yarn
Start the webpack-dev-server
and listen for file changes (supports hot reloading). Then start Electron.
yarn build
yarn watch
yarn dev
You can now start building your app:
app/app.ts (electron entry)
const createWindow = () => {
const win = new BrowserWindow({
width: 820,
height: 532,
frame: false,
titleBarStyle: "hiddenInset",
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
})
win.show()
}
app.whenReady().then(createWindow)
app/components/App.tsx
export default function App() {
return null
}
Package your app using electron-builder
. Output can be found in /dist
yarn package
Other Electron React boilerplates come with a ton of additional dependencies and a predefined file structure.
This template is preconfigured from scratch and only includes essential parts and scripts so you can start developing right away.
├── app
├── components
│ └── App.tsx // rendered component
├── app.ts // electron entry file
├── index.html
├── root.tsx // react renderer
└── manifest.json
├── build // webpack build output
├── dist // electron-builder output
├── package.json
├── tsconfig.json
└── webpack.config.js