Skip to content
Discussion options

You must be logged in to vote

It can be done without touching Cloudflare's Vite plugin. Storybook builds static HTML and it can be served as usual static content.
The only significant change is worker entry point which points requests to assets bucket. I placed it in .storybook but can be anywhere:

  • .storybook/worker.js:
    export default {
      async fetch(request, env) {
        return env.ASSETS.fetch(request);
      },
    };
  • wrangler.jsonc:
    {
      "name": "storybook", // can be any
      "compatibility_date": "2025-08-18",
      "assets": {
        "directory": "./storybook-static", // default build output directory
        "binding": "ASSETS",
      },
      "main": "./.storybook/worker.js", // worker entry point
    }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kpyszkowski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant