adapter

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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:

  1. 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.
  2. Log the capability summary so operators see what the bundle supports before it deploys.
  3. Invoke `npx esbuild` to bundle worker_entry.mjs + all compiled Next modules it transitively imports into a single ESM Worker bundle.
  4. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL