1.2.3 • Published 1 year ago

@capri-js/cloudflare v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Capri 🍋 SSR on Cloudflare Pages

Usage

// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import capri from "@capri-js/react";
import cloudflare from "@capri-js/cloudflare";

export default defineConfig({
  plugins: [
    react(),
    capri({
      target: cloudflare({
        // options (see below)
      }),
    }),
  ],
});

Options

The output can be configured using the following options:

webStreamsPolyfill

Some libraries like react-dom/server require the streams_enable_constructors feature flag to be enabled. As a workaround, you can set this option to true.

type - What kind of function to create

  • When set to "worker", Capri will generate a _worker.js file at the root of your output directory. In this case, Cloudflare will ignore any custom functions present in /functions.

  • When set to "middleware, Capri will generate a /functions/_middleware.js file instead. This allows you to use your own custom functions in addition to Capri.

  • When set to "auto" (default), Capri will generate a worker unless a /functions directory is present, in which case a middleware will be generated instead.

1.2.3

1 year ago

1.2.0

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0-next.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

2 years ago

1.0.0-next.9

2 years ago

1.0.0-next.8

2 years ago

1.0.0-next.7

2 years ago

1.0.0-next.6

2 years ago

1.0.0-next.5

2 years ago

1.0.0-next.4

2 years ago

1.0.0-next.3

2 years ago

1.0.0-next.2

2 years ago

1.0.0-next.1

2 years ago