1.1.13 ā€¢ Published 3 months ago

@jill64/adapter-cloudflare v1.1.13

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@jill64/adapter-cloudflare

šŸ”Œ 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

1.1.13

3 months ago

1.1.12

3 months ago

1.1.11

3 months ago

1.1.10

4 months ago

1.1.9

4 months ago

1.1.8

4 months ago

1.1.7

4 months ago

1.1.6

4 months ago

1.1.5

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago

0.0.1

5 months ago