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

@sveltejs/adapter-cloudflare

Package Overview
Dependencies
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-cloudflare - npm Package Compare versions

Comparing version 3.0.2 to 4.0.0

12

index.d.ts

@@ -8,2 +8,14 @@ import { Adapter } from '@sveltejs/kit';

/**
* Whether to render a plaintext 404.html page, or a rendered SPA fallback page. This page will
* only be served when a request that matches an entry in `routes.exclude` fails to match an asset.
*
* Most of the time `plaintext` is sufficient, but if you are using `routes.exclude` to manually
* exclude a set of prerendered pages without exceeding the 100 route limit, you may wish to
* use `spa` instead to avoid showing an unstyled 404 page to users.
*
* @default 'plaintext'
*/
fallback?: 'plaintext' | 'spa';
/**
* Customize the automatically-generated `_routes.json` file

@@ -10,0 +22,0 @@ * https://developers.cloudflare.com/pages/platform/functions/routing/#create-a-_routesjson-file

11

index.js

@@ -17,6 +17,13 @@ import { writeFileSync } from 'node:fs';

builder.rimraf(tmp);
builder.mkdirp(dest);
builder.mkdirp(tmp);
// generate 404.html first which can then be overridden by prerendering, if the user defined such a page
await builder.generateFallback(path.join(dest, '404.html'));
// generate plaintext 404.html first which can then be overridden by prerendering, if the user defined such a page
const fallback = path.join(dest, '404.html');
if (options.fallback === 'spa') {
await builder.generateFallback(fallback);
} else {
writeFileSync(fallback, 'Not Found');
}

@@ -23,0 +30,0 @@ const dest_dir = `${dest}${builder.config.kit.paths.base}`;

4

package.json
{
"name": "@sveltejs/adapter-cloudflare",
"version": "3.0.2",
"version": "4.0.0",
"description": "Adapter for building SvelteKit applications on Cloudflare Pages with Workers integration",

@@ -36,3 +36,3 @@ "repository": {

"typescript": "^5.3.3",
"@sveltejs/kit": "^2.3.2"
"@sveltejs/kit": "^2.3.3"
},

@@ -39,0 +39,0 @@ "peerDependencies": {

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