MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / createPackedWorkerBundlerSource

Function createPackedWorkerBundlerSource

apps/cli/src/build.ts:48–64  ·  view source on GitHub ↗
(distPath: string)

Source from the content-addressed store, hash-verified

46};
47
48const createPackedWorkerBundlerSource = async (distPath: string): Promise<string> => {
49 const esbuildPath = join(repoRoot, "node_modules/.bun/node_modules/esbuild/lib/main.js");
50 if (!existsSync(esbuildPath)) throw new Error(`esbuild not found at ${esbuildPath}`);
51 const { build } = await import(pathToFileURL(esbuildPath).href);
52 const result = await build({
53 entryPoints: [join(distPath, "index.js")],
54 bundle: true,
55 format: "esm",
56 platform: "browser",
57 external: ["./esbuild.wasm"],
58 logLevel: "silent",
59 write: false,
60 });
61 const source = result.outputFiles[0]?.text;
62 if (source === undefined) throw new Error("failed to bundle @cloudflare/worker-bundler");
63 return source;
64};
65
66// ---------------------------------------------------------------------------
67// Metadata

Callers 1

buildBinariesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected