Cloudflare Functions Plugin

Integrate serverless Cloudflare Workers/Functions with your 11ty website powered by Standard Framework.

What’s Included

The Cloudflare Functions plugin provides basic integration for serverless functions with your 11ty project:

Quick Start

1. Install

npm install @zefish/standard

2. Add to eleventy.config.js

import CloudflarePlugin from "@zefish/standard/cloudflare";

export default function (eleventyConfig) {
  eleventyConfig.addPlugin(CloudflarePlugin, {
    outputDir: "functions",
    environment: "production",
  });
}

3. Create Your First Function

// functions/hello.js

export default {
  async fetch(request) {
    return new Response("Hello from Cloudflare Function!");
  },
};

4. Deploy

npm run build
wrangler publish

Systems & Plugins

Core Plugin

Simplified API Endpoints

Documentation

Features

✅ Automatic function copying to build output
✅ Environment variables support
✅ Global data available in templates
✅ Cloudflare configuration template

Integration with Standard Framework

Works seamlessly with the full Standard Framework:

import Standard from "@zefish/standard";
import CloudflarePlugin from "@zefish/standard/cloudflare";

export default function (eleventyConfig) {
  // Typography & styling framework
  eleventyConfig.addPlugin(Standard);

  // Serverless functions
  eleventyConfig.addPlugin(CloudflarePlugin);
}

Next Steps

Version

Cloudflare Functions Plugin v0.10.52
Part of Standard Framework


Ready to add serverless to your 11ty site? Get started now