mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-27 20:00:51 +00:00
Includes all Phase 3 rounds (1-5), Node unit test mock compatibility fixes, and Codex review fixes (pinyin readiness subscribers & KnownHostsManager mount retention).
27 lines
890 B
JavaScript
27 lines
890 B
JavaScript
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { build } from "esbuild";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const rootDir = path.resolve(__dirname, "..");
|
|
const entryPoint = path.join(rootDir, "electron", "preload.cjs");
|
|
const outfile = path.join(rootDir, "electron", "preload.bundle.cjs");
|
|
|
|
await build({
|
|
entryPoints: [entryPoint],
|
|
outfile,
|
|
bundle: true,
|
|
format: "cjs",
|
|
// Browser platform enforces zero Node.js builtin requires (only `electron` is
|
|
// external), guaranteeing sandbox: true compatibility at build time while
|
|
// preserving Electron's injected `process` global.
|
|
platform: "browser",
|
|
target: "chrome140",
|
|
external: ["electron"],
|
|
minify: true,
|
|
legalComments: "none",
|
|
banner: {
|
|
js: "// Generated by scripts/build-preload.mjs for Electron sandbox: true. Do not edit directly.",
|
|
},
|
|
});
|