Skip to content

Commit a9dbd69

Browse files
authored
Merge pull request #228 from electron-vite/v0.28.5
V0.28.5
2 parents 06d8144 + 34423e7 commit a9dbd69

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 0.28.5 (2024-04-19)
2+
3+
- f325403 chore: update comments
4+
- 5ebd3a6 Merge pull request #229 from ThatKawaiiSam/feat/custom-electron-fork
5+
- dbc85dc feat: allow custom electron forks in `startup` call
6+
- 8b076be chore: update deprecated API
7+
8+
**Contributors:**
9+
10+
- [#229](https://github.com/electron-vite/vite-plugin-electron/pull/229)@[ThatKawaiiSam](https://github.com/ThatKawaiiSam)
11+
112
## 0.28.4 (2024-03-17)
213

314
- 4f7748c chore: restore `vite-plugin-electron-renderer` in `peerDependencies`

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ export interface ElectronOptions {
146146
* Electron App startup function.
147147
* It will mount the Electron App child-process to `process.electronApp`.
148148
* @param argv default value `['.', '--no-sandbox']`
149+
* @param options options for `child_process.spawn`
150+
* @param customElectronPkg custom electron package name (default: 'electron')
149151
*/
150152
startup: (argv?: string[], options?: import('node:child_process').SpawnOptions) => Promise<void>
151153
/** Reload Electron-Renderer */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-electron",
3-
"version": "0.28.4",
3+
"version": "0.28.5",
44
"description": "Electron 🔗 Vite",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export interface ElectronOptions {
3232
* Electron App startup function.
3333
* It will mount the Electron App child-process to `process.electronApp`.
3434
* @param argv default value `['.', '--no-sandbox']`
35+
* @param options options for `child_process.spawn`
36+
* @param customElectronPkg custom electron package name (default: 'electron')
3537
*/
3638
startup: (argv?: string[], options?: import('node:child_process').SpawnOptions) => Promise<void>
3739
/** Reload Electron-Renderer */
@@ -78,7 +80,7 @@ export default function electron(options: ElectronOptions | ElectronOptions[]):
7880
startup,
7981
reload() {
8082
if (process.electronApp) {
81-
server.ws.send({ type: 'full-reload' })
83+
server.hot.send({ type: 'full-reload' })
8284
} else {
8385
startup()
8486
}
@@ -118,14 +120,17 @@ export default function electron(options: ElectronOptions | ElectronOptions[]):
118120
* Electron App startup function.
119121
* It will mount the Electron App child-process to `process.electronApp`.
120122
* @param argv default value `['.', '--no-sandbox']`
123+
* @param options options for `child_process.spawn`
124+
* @param customElectronPkg custom electron package name (default: 'electron')
121125
*/
122126
export async function startup(
123127
argv = ['.', '--no-sandbox'],
124128
options?: import('node:child_process').SpawnOptions,
129+
customElectronPkg?: string,
125130
) {
126131
const { spawn } = await import('node:child_process')
127132
// @ts-ignore
128-
const electron = await import('electron')
133+
const electron = await import(customElectronPkg ?? 'electron')
129134
const electronPath = <any>(electron.default ?? electron)
130135

131136
await startup.exit()

0 commit comments

Comments
 (0)