Documentation
¶
Overview ¶
Package adapter compiles and bundles Next.js standalone builds for Cloudflare Workers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildWorkerBundle ¶
func BuildWorkerBundle( ctx context.Context, standaloneDir string, meta *nextcore.NextCorePayload, cfg *config.NextDeployConfig, log *shared.Logger, ) (string, error)
BuildWorkerBundle adapts a Next.js standalone build into a single Cloudflare Worker module bundle.
Pipeline:
- Run nextcompile.Compile against the standalone tree + nextcore payload. This produces <standaloneDir>/.nextdeploy-cf/_nextdeploy/{manifest.json, dispatch.mjs, action_manifest.json, worker_entry.mjs}, extracts the embedded JS runtime, and (when RSC is used) vendors react-server-dom-webpack.
- Log the capability summary so operators see what the bundle supports before it deploys.
- Invoke `npx esbuild` to bundle worker_entry.mjs + all compiled Next modules it transitively imports into a single ESM Worker bundle.
- Return the final bundle path.
Requires Node + npx on PATH for step 3. Every other step is pure Go.
`meta` may be nil for the static-export path (DeployCompute skips early in that case), but every Worker-deploy call path supplies it.
Types ¶
This section is empty.