sveltejs / sveltejs/kit

docs: static site on Cloudflare Workers

Open
#15,233 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pkg:adapter-static
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

Turns out, you CAN deploy static sites to Cloudflare Workers:

The main key is optional for assets-only Workers. Source

// wrangler.jsonc
{
  "$schema": "./node_modules/wrangler/config-schema.json", // optional
  "name": "svelte-kit-project",
  "compatibility_flags": ["nodejs_als"], // optional
  "compatibility_date": "2026-01-31",
  "assets": {
    "directory": "./build" // adapter-static
  }
}

You can even set the 404 page.

The default behavior for requests which don't match a static asset can be changed by setting the not_found_handling option under assets in your Wrangler configuration file.

Describe the proposed solution

Current docs has guide for Vercel and GitHub Pages. Add a Cloudflare Workers section.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the existing adapter-static documentation, especially the Vercel and GitHub Pages guidance, and review the linked Wrangler configuration references. Done means documenting a Cloudflare Workers deployment using the shown assets directory configuration, including how to configure the 404 page.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.