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

Function createPackedWorkerBundlerSource

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

Source from the content-addressed store, hash-verified

72};
73
74const createPackedWorkerBundlerSource = async (distPath: string): Promise<string> => {
75 const esbuildPath = join(repoRoot, "node_modules/.bun/node_modules/esbuild/lib/main.js");
76 if (!existsSync(esbuildPath)) throw new Error(`esbuild not found at ${esbuildPath}`);
77 const { build } = await import(pathToFileURL(esbuildPath).href);
78 const result = await build({
79 entryPoints: [join(distPath, "index.js")],
80 bundle: true,
81 format: "esm",
82 platform: "browser",
83 external: ["./esbuild.wasm"],
84 logLevel: "silent",
85 write: false,
86 });
87 const source = result.outputFiles[0]?.text;
88 if (source === undefined) throw new Error("failed to bundle @cloudflare/worker-bundler");
89 return source;
90};
91
92// ---------------------------------------------------------------------------
93// Metadata

Callers 1

buildBinariesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected