Skip to content

Commit 8fa6ce4

Browse files
committed
feat: update package and example
1 parent 1d7eca5 commit 8fa6ce4

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

electron-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ declare namespace NodeJS {
66
}
77

88
interface Process {
9-
electronApp: import('child_process').ChildProcess
9+
electronApp: import('node:child_process').ChildProcess
1010
}
1111
}
1212

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
"license": "MIT",
1919
"scripts": {
2020
"dev": "vite build --watch",
21-
"build": "rm -rf types && tsc --emitDeclarationOnly && vite build",
21+
"build": "rimraf types && tsc --emitDeclarationOnly && vite build",
2222
"prepublishOnly": "npm run test && npm run build",
2323
"test": "vitest run"
2424
},
25-
"dependencies": {},
2625
"devDependencies": {
26+
"rimraf": "^3.0.2",
27+
"rollup": "^3.9.0",
2728
"typescript": "^4.9.4",
2829
"vite": "^4.0.3",
29-
"vitest": "^0.26.2",
30-
"rollup": "^3.8.1"
30+
"vitest": "^0.26.2"
3131
},
3232
"files": [
3333
"types",

pnpm-lock.yaml

+11-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default function electron(config: Configuration | Configuration[]): Plugi
8585
* @param argv default value `['.', '--no-sandbox']`
8686
*/
8787
export async function startup(argv = ['.', '--no-sandbox']) {
88-
const { spawn } = await import('child_process')
88+
const { spawn } = await import('node:child_process')
8989
// @ts-ignore
9090
const electron = await import('electron')
9191
const electronPath = <any>(electron.default ?? electron)

vite.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from 'vite'
2-
import { builtinModules } from 'module'
2+
import { builtinModules } from 'node:module'
33
import pkg from './package.json'
44

55
export default defineConfig({
@@ -18,7 +18,7 @@ export default defineConfig({
1818
'vite',
1919
...builtinModules,
2020
...builtinModules.map(m => `node:${m}`),
21-
...Object.keys(pkg.dependencies),
21+
...Object.keys("dependencies" in pkg ? pkg.dependencies as object : {}),
2222
],
2323
output: {
2424
exports: 'named',

0 commit comments

Comments
 (0)