Skip to main content

WorkersSiteStaticContentBinding

Overview

An environment binding available within Worker Sites. This is often used with the @cloudflare/kv-asset-handler package.

This binding only exists in Worker Sites. Cloudflare Pages instead uses env.ASSETS

When using ESBuild, ensure that the virtual module __STATIC_CONTENT_MANIFEST is marked as external:

import {build} from 'esbuild'

build({ external: ['__STATIC_CONTENT_MANIFEST']})

For usage with TypeScript, you'll need to define a module type as well:

// types/cloudflare-worker.d.ts
declare module '__STATIC_CONTENT_MANIFEST'

See

Usage

import { WorkersSiteStaticContentBinding } from 'keywork/middleware/classes'

Properties

__STATIC_CONTENT

__STATIC_CONTENT: `KVNamespace<string>`

Defined in

middleware/classes/WorkerSitesAssetRouter.ts:60