Skip to content

Commit 8db4afc

Browse files
authored
Merge pull request #40 from electron-vite/v0.7.0
V0.7.0
2 parents 915cf6b + 3665b79 commit 8db4afc

File tree

9 files changed

+491
-320
lines changed

9 files changed

+491
-320
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.7.0 (2024-04-21)
2+
3+
- 0dcdf39 chore: remove `globalThis.__dirname`
4+
- f48de08 feat: add `.npmrc` to template
5+
- 9c84030 feat: support esmodule
6+
- e2c3822 chore: bump deps
7+
18
## 0.6.0 (2024-04-18)
29

310
- 28f7b4a fix: compatible vitest #26

electron/main.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import { app, BrowserWindow } from 'electron'
2+
import { createRequire } from 'node:module'
3+
import { fileURLToPath } from 'node:url'
24
import path from 'node:path'
35

6+
const require = createRequire(import.meta.url)
7+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
8+
49
// The built directory structure
510
//
611
// ├─┬─┬ dist
712
// │ │ └── index.html
813
// │ │
914
// │ ├─┬ dist-electron
1015
// │ │ ├── main.js
11-
// │ │ └── preload.js
16+
// │ │ └── preload.mjs
1217
// │
1318
process.env.APP_ROOT = path.join(__dirname, '..')
1419

@@ -25,7 +30,7 @@ function createWindow() {
2530
win = new BrowserWindow({
2631
icon: path.join(process.env.VITE_PUBLIC, 'electron-vite.svg'),
2732
webPreferences: {
28-
preload: path.join(__dirname, 'preload.js'),
33+
preload: path.join(__dirname, 'preload.mjs'),
2934
},
3035
})
3136

electron/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"devDependencies": {
3-
"electron": "^29.1.4",
3+
"electron": "^30.0.1",
44
"electron-builder": "^24.13.3",
5-
"vite-plugin-electron": "^0.28.4",
5+
"vite-plugin-electron": "^0.28.6",
66
"vite-plugin-electron-renderer": "^0.14.5"
77
}
8-
}
8+
}

package.json

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-electron-vite",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"type": "module",
55
"description": "Scaffolding Your Electron + Vite Project",
66
"license": "MIT",
@@ -42,15 +42,12 @@
4242
"prompts": "^2.4.2"
4343
},
4444
"devDependencies": {
45-
"@types/node": "^18.11.18",
46-
"@types/prompts": "^2.4.2",
47-
"execa": "^7.1.1",
48-
"typescript": "^4.9.4",
49-
"vite": "^4.3.9",
50-
"vitest": "^0.29.3"
51-
},
52-
"engines": {
53-
"node": "^14.18.0 || >=16.0.0"
45+
"@types/node": "^20.12.7",
46+
"@types/prompts": "^2.4.9",
47+
"execa": "^8.0.1",
48+
"typescript": "^5.4.5",
49+
"vite": "^5.2.9",
50+
"vitest": "^1.5.0"
5451
},
5552
"packageManager": "[email protected]"
5653
}

0 commit comments

Comments
 (0)