Skip to content

Commit 8e70a39

Browse files
committed
chore: cleanup
1 parent 20dd675 commit 8e70a39

File tree

5 files changed

+131
-133
lines changed

5 files changed

+131
-133
lines changed

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ export default {
103103
plugins: [
104104
electron({
105105
main: {
106+
// Shortcut of `build.lib.entry`
106107
entry: 'electron/main.ts',
107108
},
108-
// Optional: input must be use absolute path
109109
preload: {
110-
input: __dirname + '/electron/preload.ts',
110+
// Shortcut of `build.rollupOptions.input`
111+
input: 'electron/preload.ts',
111112
},
112113
// Optional: Use Node.js API in the Renderer process
113114
renderer: {},
@@ -165,15 +166,9 @@ Let's use the official [template-vanilla-ts](https://github.com/vitejs/vite/tree
165166
+ └── vite.config.ts
166167
```
167168

168-
## [Examples](https://github.com/electron-vite/vite-plugin-electron/tree/main/examples)
169+
## Examples
169170

170-
- [quick-start](https://github.com/electron-vite/vite-plugin-electron/tree/main/examples/quick-start)
171-
- [multiple-renderer](https://github.com/electron-vite/vite-plugin-electron/tree/main/examples/multiple-renderer)
172-
- [bytecode](https://github.com/electron-vite/vite-plugin-electron/tree/main/examples/bytecode)
173-
<!--
174-
- [multiple-window](https://github.com/electron-vite/vite-plugin-electron/tree/main/examples/multiple-window)
175-
- [custom-start-electron-app](https://github.com/electron-vite/vite-plugin-electron/tree/main/examples/custom-start-electron-app)
176-
-->
171+
There are many cases here 👉 [electron-vite-samples](https://github.com/caoxiemeihao/electron-vite-samples)
177172

178173
## JavaScript API
179174

@@ -328,3 +323,10 @@ Modules in `node_modules` are not bundled during development, it's fast!
328323
│ const log = require('electron-log') │
329324
┗—————————————————————————————————————┛
330325
```
326+
327+
## FAQ
328+
329+
- `electron` does not exit correctly | 使用ctrl + c 停止代码,electron后台不关闭 | [#122](https://github.com/electron-vite/vite-plugin-electron/pull/122), [#168](https://github.com/electron-vite/vite-plugin-electron/issues/168)
330+
331+
* Add `tree-kill` into you dependencies, `npm i -D tree-kill`.
332+

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"prepublishOnly": "npm run build && npm run test"
3838
},
3939
"peerDependencies": {
40-
"vite-plugin-electron-renderer": "*",
41-
"tree-kill": "*"
40+
"tree-kill": "*",
41+
"vite-plugin-electron-renderer": "*"
4242
},
4343
"peerDependenciesMeta": {
4444
"vite-plugin-electron-renderer": {
@@ -49,11 +49,12 @@
4949
}
5050
},
5151
"devDependencies": {
52-
"rollup": "^3.17.2",
53-
"typescript": "^4.9.5",
54-
"vite": "^4.1.4",
52+
"rollup": "^3.29.4",
53+
"tree-kill": "^1.2.2",
54+
"typescript": "^5.2.2",
55+
"vite": "^4.5.0",
5556
"vite-plugin-electron-renderer": "^0.14.5",
56-
"vitest": "^0.28.5"
57+
"vitest": "^0.34.6"
5758
},
5859
"files": [
5960
"dist",

0 commit comments

Comments
 (0)