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

@jill64/adapter-cloudflare

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jill64/adapter-cloudflare

🔌 SvelteKit Adapter for Cloudflare Pages with nodejs_compat

  • 1.1.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@jill64/adapter-cloudflare

npm-version npm-license npm-download-month npm-min-size ci.yml

🔌 SvelteKit Adapter for Cloudflare Pages with nodejs_compat

[!IMPORTANT]

EOL

Node.js compatibility is currently available at @sveltejs/adapter-cloudflare@4.1.0

Old Documents

This adapter is based on Node.js compatibility and allows some node modules to be used with Cloudflare Pages.

Installation

npm i -D @jill64/adapter-cloudflare

Usage

  1. Add the adapter to your project. Adapter options are compatible with @sveltejs/adapter-cloudflare.
// svelte.config.js
import adapter from '@jill64/adapter-cloudflare'

export default {
  kit: {
    adapter: adapter({
      /* @sveltejs/adapter-cloudflare options */
      // routes: {
      //   // ...
      // }
    })
  }
}

If you need a node module that is not officially supported, add a polyfill with the following options based on esbuild-plugin-polyfill-node.

// svelte.config.js
import adapter from '@jill64/adapter-cloudflare'

export default {
  kit: {
    adapter: adapter({
      // /* esbuild-plugin-polyfill-node options */
      // globals: {
      //   // ...
      // },
      // polyfills: {
      //   // ...
      // }
    })
  }
}
  1. Enable Node.js compatibility in Cloudflare Pages.

    1. Go to Pages project page.
    2. Click the "Settings" => "Functions".
    3. Add nodejs_compat to the Compatibility flags.
  2. Deploy your project.

License

MIT

Keywords

FAQs

Package last updated on 07 Feb 2024

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