Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Static Assets

Explains how the Cloudflare Workers Vite plugin automatically handles static assets, including configuration requirements, automatic directory detection, and implementing single-page application fallback routing.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Static Assets

Explains how the Cloudflare Workers Vite plugin automatically handles static assets, including configuration requirements, automatic directory detection, and implementing single-page application fallback routing.

When To Use

Use when configuring a Cloudflare Worker with Vite to automatically manage static asset builds, set up SPA routing fallbacks, or access assets via bindings in a client environment.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-vite-plugin-static-assets-workflow-guide.mdDocumentation detailing the configuration, features, and header management for using static assets with the Cloudflare Workers Vite plugin.Questions about documentation detailing the configuration, features, and header management for using static assets with the Cloudflar...
examples/workers-vite-plugin-static-assets-cloudflare-workers-vite-plugin-static-.textA configuration object demonstrating the assets property settings for the Cloudflare Workers Vite plugin, including single-page application notfoundhandling.Exact payloads, commands, or snippets shown in A configuration object demonstrating the assets property settings for the Cloudflare Workers Vite plugin, including s...
examples/workers-vite-plugin-static-assets-cloudflare-workers-vite-plugin-static--2.textA configuration example for the Cloudflare Workers Vite plugin demonstrating the [assets] block and single-page application notfoundhandling setting.Exact payloads, commands, or snippets shown in A configuration example for the Cloudflare Workers Vite plugin demonstrating the [assets] block and single-page appli...
examples/workers-vite-plugin-static-assets-cloudflare-workers-vite-plugin-static--3.textA JavaScript code example demonstrating how to import and fetch static assets using the Cloudflare Workers Vite plugin.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to import and fetch static assets using the Cloudflare Workers Vite plugin.

What This Skill Covers

  • This guide focuses on the areas of working with static assets that are unique to the Vite plugin. For more general documentation, see Static Assets.
  • Main sections: Configuration, Features, Headers and redirects.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/vite-plugin/reference/static-assets