mirror of
https://github.com/SawyerHood/dev-browser.git
synced 2026-09-20 13:44:44 +08:00
21 lines
548 B
TypeScript
21 lines
548 B
TypeScript
import { mkdir } from "node:fs/promises";
|
|
import { dirname, resolve } from "node:path";
|
|
|
|
import { build } from "esbuild";
|
|
|
|
const daemonDir = resolve(import.meta.dirname, "..");
|
|
const entryPoint = resolve(daemonDir, "src/sandbox/forked-client/bundle-entry.ts");
|
|
const outfile = resolve(daemonDir, "dist/sandbox-client.js");
|
|
|
|
await mkdir(dirname(outfile), { recursive: true });
|
|
|
|
await build({
|
|
entryPoints: [entryPoint],
|
|
bundle: true,
|
|
format: "iife",
|
|
globalName: "__PlaywrightClient",
|
|
outfile,
|
|
platform: "neutral",
|
|
target: "es2022",
|
|
});
|