feat: improvement to template

This commit is contained in:
xhayper committed 2022-12-23 23:39:53 +07:00
1 parent 2889ab3ac8
commit 7cbc3ded05
39 files changed
+331 -339

No files matched your search

+13 -18
View File
@@ -24,36 +24,29 @@ English | [简体中文](README.zh-CN.md)
npm create electron-vite
```
![electron-vite-react.gif](https://github.com/electron-vite/electron-vite-react/blob/main/public/electron-vite-react.gif?raw=true)
![electron-vite-react.gif](/public/electron-vite-react.gif)
## 🐞 Debug
![electron-vite-react-debug.gif](https://github.com/electron-vite/electron-vite-react/blob/main/public/electron-vite-react-debug.gif?raw=true)
![electron-vite-react-debug.gif](/electron-vite-react-debug.gif)
## 📂 Directory structure
Familiar React application structure, just with `electron` folder on the top :wink:
*Files in this folder will be separated from your React application and built into `dist/electron`*
*Files in this folder will be separated from your React application and built into `dist-electron`*
```tree
├── electron Electron-related code
│ ├── main Main-process source code
│ ├── preload Preload-scripts source code
│ └── resources Resources for the production build
│ ├── icon.icns Icon for the application on macOS
│ ├── icon.ico Icon for the application
│ ├── installerIcon.ico Icon for the application installer
│ ├── uninstallerIcon.ico Icon for the application uninstaller
| └── iconset
| └── 256x256.png Icon for the application on Linux
├── electron Electron-related code
│ ├── main Main-process source code
│ └── preload Preload-scripts source code
│
├── release Generated after production build, contains executables
├── release Generated after production build, contains executables
│ └── {version}
│ ├── {os}-unpacked Contains unpacked application executable
│ └── Setup.{ext} Installer for the application
│ ├── {os}-{os_arch} Contains unpacked application executable
│ └── {app_name}_{version}.{ext} Installer for the application
│
├── public Static assets
└── src Renderer source code, your React application
├── public Static assets
└── src Renderer source code, your React application
```
## 🚨 Be aware
@@ -67,10 +60,12 @@ To get started, remove the option as shown below. This will [modify the Vite con
export default {
plugins: [
...
- // Use Node.js API in the Renderer-process
- renderer({
- nodeIntegration: true,
- }),
...
],
}
```