Spaces:
Paused
Paused
Download scripts/build-fork-worker.ts from bolikoto/zcode-daili: direct link, hf CLI and curl.
- Browser
- Download file 933 Bytes
-
https://huggingface.co/spaces/bolikoto/zcode-daili/resolve/main/scripts/build-fork-worker.ts
- Command line
-
hf download hf://spaces/bolikoto/zcode-daili/scripts/build-fork-worker.ts
-
curl -L -o build-fork-worker.ts https://huggingface.co/spaces/bolikoto/zcode-daili/resolve/main/scripts/build-fork-worker.ts
933 Bytes
| /** | |
| * Bundles the captcha worker entry into a self-contained ESM file for | |
| * embedding as a `with { type: "file" }` asset in the compiled single-file | |
| * binary. Raw .ts assets are NOT parsed by Bun at extraction (they'd be | |
| * evaluated as plain JS and fail on type annotations), so the worker must | |
| * be pre-bundled to plain JS. | |
| * | |
| * Run before `bun build --compile` (every build:* script chains it): | |
| * bun run scripts/build-fork-worker.ts | |
| * Output: src/proxy/captcha-worker-entry.bundle.js (gitignored build input) | |
| */ | |
| import { build } from "bun"; | |
| const result = await build({ | |
| entrypoints: ["./src/proxy/captcha-worker-entry.ts"], | |
| outdir: "./src/proxy", | |
| target: "bun", | |
| format: "esm", | |
| naming: { entry: "[dir]/[name].bundle.[ext]" }, | |
| minify: false, | |
| external: [], | |
| }); | |
| for (const log of result.logs) console.log(String(log)); | |
| console.log(`captcha worker bundled: ${result.outputs.map((o) => o.path).join(", ")}`); | |