Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.7.0 #40

Merged
merged 5 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading