You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
13
13
## Overview
14
14
15
-
This is an`Vite`-integrated `Electron` template built with simplification in mind.
15
+
This is a`Vite`-integrated `Electron` template built with simplification in mind.
16
16
17
17
The repo contains only the most basic files, dependencies and functionalities to ensure flexibility for various scenarios.
18
18
@@ -61,11 +61,11 @@ A `dist` folder will be generated everytime when `dev` or `build` command is exe
61
61
62
62
## Use Electron, NodeJs API
63
63
64
-
> 🚧 By default, using Electron or NodeJS API in the rederer process is discouraged. For anyone who needs to bypass this security constrain, take a look at this template 👉 **[electron-vite-boilerplate](https://github.com/caoxiemeihao/electron-vite-boilerplate)**
64
+
> 🚧 By default, using Electron or NodeJS API in the rederer process is strongly discouraged. For anyone who needs to bypass the security constraints, take a look at this template 👉 **[electron-vite-boilerplate](https://github.com/caoxiemeihao/electron-vite-boilerplate)**
65
65
66
66
As electron suggested, if you need access to the Electron and NodeJS API in the renderer process, you need to create a context bridge and expose the APIs you need to the renderer process.
67
67
68
-
Note that if your project uses typescript, you also need to add type declearations to `Window` interface.
68
+
Note that if your project uses typescript, you also need to add type declarations to the`Window` interface.
69
69
70
70
***packages/preload/index.ts**
71
71
@@ -98,9 +98,9 @@ Note that if your project uses typescript, you also need to add type declearatio
98
98
99
99
## Use SerialPort, SQLite3 or other node-native addons in Main-process
100
100
101
-
- First you need to make sure the packages are listed in the "dependencies", since they are still needed during runtime after the project is bundled.
101
+
- First, you need to make sure the packages are listed in the "dependencies" since they are still needed at runtime after the project is packed.
102
102
103
-
- Source code of main process and preload scripts are also bundled with Vite[build.lib](https://vitejs.dev/config/#build-lib). Rollup configurations are needed.
103
+
- Source code of main process and preload scripts are also bundled with Vite[build.lib](https://vitejs.dev/config/#build-lib). Rollup configurations needed.
- First, you need to know if the package is still needed during runtime after packaged.
129
+
- First, you need to know if the package is still needed at runtime after packed.
130
130
131
131
- Packages like [serialport](https://www.npmjs.com/package/serialport), [sqlite3](https://www.npmjs.com/package/sqlite3) are node-native modules and should be placed in `dependencies`. Vite will not build them and will treat them as externals.
0 commit comments