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

@sveltejs/adapter-vercel

Package Overview
Dependencies
Maintainers
4
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-vercel - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

25

index.js

@@ -9,2 +9,4 @@ import fs from 'node:fs';

const DEFAULT_FUNCTION_NAME = 'fn';
const get_default_runtime = () => {

@@ -218,3 +220,3 @@ const major = process.version.slice(1).split('.')[0];

// generate one function for the group
const name = singular ? 'fn' : `fn-${group.i}`;
const name = singular ? DEFAULT_FUNCTION_NAME : `fn-${group.i}`;

@@ -292,8 +294,21 @@ await generate_function(

if (singular) {
// Common case: One function for all routes
// Needs to happen after ISR or else regex swallows all other matches
static_config.routes.push({ src: '/.*', dest: `/fn` });
if (!singular) {
// we need to create a catch-all route so that 404s are handled
// by SvelteKit rather than Vercel
const runtime = defaults.runtime ?? get_default_runtime();
const generate_function =
runtime === 'edge' ? generate_edge_function : generate_serverless_function;
await generate_function(
DEFAULT_FUNCTION_NAME,
/** @type {any} */ ({ runtime, ...defaults }),
[]
);
}
// Catch-all route must come at the end, otherwise it will swallow all other routes,
// including ISR aliases if there is only one function
static_config.routes.push({ src: '/.*', dest: `/${DEFAULT_FUNCTION_NAME}` });
builder.log.minor('Copying assets...');

@@ -300,0 +315,0 @@

4

package.json
{
"name": "@sveltejs/adapter-vercel",
"version": "2.2.0",
"version": "2.2.1",
"repository": {

@@ -32,3 +32,3 @@ "type": "git",

"typescript": "^4.9.4",
"@sveltejs/kit": "^1.8.7"
"@sveltejs/kit": "^1.9.2"
},

@@ -35,0 +35,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