This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@jill64/adapter-cloudflare
TypeScript icon, indicating that this package has built-in type declarations

1.1.13Β β€’Β PublicΒ β€’Β Published

@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

Package Sidebar

Install

npm i @jill64/adapter-cloudflare

Weekly Downloads

18

Version

1.1.13

License

MIT

Unpacked Size

14.3 kB

Total Files

9

Last publish

Collaborators

  • jill64