Skip to content

Commit

Permalink
Merge pull request #40 from electron-vite/v0.7.0
Browse files Browse the repository at this point in the history
V0.7.0
  • Loading branch information
caoxiemeihao authored Apr 21, 2024
2 parents 915cf6b + 3665b79 commit 8db4afc
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 320 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.7.0 (2024-04-21)

- 0dcdf39 chore: remove `globalThis.__dirname`
- f48de08 feat: add `.npmrc` to template
- 9c84030 feat: support esmodule
- e2c3822 chore: bump deps

## 0.6.0 (2024-04-18)

- 28f7b4a fix: compatible vitest #26
Expand Down
9 changes: 7 additions & 2 deletions electron/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { app, BrowserWindow } from 'electron'
import { createRequire } from 'node:module'
import { fileURLToPath } from 'node:url'
import path from 'node:path'

const require = createRequire(import.meta.url)
const __dirname = path.dirname(fileURLToPath(import.meta.url))

// The built directory structure
//
// ├─┬─┬ dist
// │ │ └── index.html
// │ │
// │ ├─┬ dist-electron
// │ │ ├── main.js
// │ │ └── preload.js
// │ │ └── preload.mjs
// │
process.env.APP_ROOT = path.join(__dirname, '..')

Expand All @@ -25,7 +30,7 @@ function createWindow() {
win = new BrowserWindow({
icon: path.join(process.env.VITE_PUBLIC, 'electron-vite.svg'),
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
preload: path.join(__dirname, 'preload.mjs'),
},
})

Expand Down
6 changes: 3 additions & 3 deletions electron/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"devDependencies": {
"electron": "^29.1.4",
"electron": "^30.0.1",
"electron-builder": "^24.13.3",
"vite-plugin-electron": "^0.28.4",
"vite-plugin-electron": "^0.28.6",
"vite-plugin-electron-renderer": "^0.14.5"
}
}
}
17 changes: 7 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-electron-vite",
"version": "0.6.0",
"version": "0.7.0",
"type": "module",
"description": "Scaffolding Your Electron + Vite Project",
"license": "MIT",
Expand Down Expand Up @@ -42,15 +42,12 @@
"prompts": "^2.4.2"
},
"devDependencies": {
"@types/node": "^18.11.18",
"@types/prompts": "^2.4.2",
"execa": "^7.1.1",
"typescript": "^4.9.4",
"vite": "^4.3.9",
"vitest": "^0.29.3"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
"@types/node": "^20.12.7",
"@types/prompts": "^2.4.9",
"execa": "^8.0.1",
"typescript": "^5.4.5",
"vite": "^5.2.9",
"vitest": "^1.5.0"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 8db4afc

Please sign in to comment.