Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capri-js/cloudflare

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capri-js/cloudflare

## Usage

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 01 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc