1.1.13 ā¢ Published 3 months ago
@jill64/adapter-cloudflare v1.1.13
@jill64/adapter-cloudflare
š SvelteKit Adapter for Cloudflare Pages with nodejs_compat
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
- 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: {
// // ...
// }
})
}
}
Enable Node.js compatibility in Cloudflare Pages.
- Go to Pages project page.
- Click the "Settings" => "Functions".
- Add
nodejs_compat
to the Compatibility flags.
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