Skip to main content

createWorkerBuildOptions

Overview

createWorkerBuildOptions

(entryPoints, outfile?): `BuildOptions`

ESBuild options for the Worker bundle.

The Worker runtime on Cloudflare Pages may differ from a standard Worker deployment.

If you're encountering runtime errors, consider adding the ReadableStream polyfill:

import esbuild from 'esbuild'

esbuild.build({
...workerBuildOptions,
inject: [require.resolve('keywork/polyfills/ReadableStream')],
})

Parameters

NameTypeDefault value
entryPointsstring[]undefined
outfilestringBundledFileName

Returns

BuildOptions

Defined in

bundling/esbuild/functions/createWorkerBuildOptions.ts:37