Skip to content

Commit 33f9e8b

Browse files
committed
fix: nexe deps bug
1 parent a554acf commit 33f9e8b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "./src/server.ts",
66
"scripts": {
77
"start": "tsx ./src/server.ts",
8+
"build:ci": "bash ./scripts/build.sh",
89
"build": "rollup -c rollup.config.mjs",
910
"build:windows": "nexe ./output/server.js -o ./output/windows/server.exe -t windows-x64-14.15.3",
1011
"build:linux": "nexe ./output/server.js -o ./output/linux/server.linux -t linux-x64-14.15.3",
@@ -20,6 +21,7 @@
2021
"fastify-sse-v2": "^4.0.0",
2122
"http-proxy-agent": "^7.0.2",
2223
"https-proxy-agent": "^7.0.5",
24+
"node-abort-controller": "^3.1.1",
2325
"node-fetch": "^3.3.2"
2426
},
2527
"devDependencies": {

pnpm-lock.yaml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/preload.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import dotenv from "dotenv";
22
import { Request, Response, Headers } from "node-fetch";
33
import fetch from "node-fetch";
4+
import { AbortController, AbortSignal } from "node-abort-controller";
45

56
dotenv.config();
67

@@ -11,3 +12,8 @@ if (!globalThis.fetch) {
1112
globalThis.Response = Response as any;
1213
globalThis.Headers = Headers as any;
1314
}
15+
// NOTE: nexe 最高只有 node14 ...
16+
if (!globalThis.AbortController) {
17+
globalThis.AbortController = AbortController as any;
18+
globalThis.AbortSignal = AbortSignal as any;
19+
}

0 commit comments

Comments
 (0)