@vercel/backends 0.8.18 → 0.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -7
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -2251,14 +2251,14 @@ const build = async (args) => {
2251
2251
  VERCEL_SERVICE_ROUTE_PREFIX_STRIP: "1"
2252
2252
  };
2253
2253
  const serviceName = typeof args.config?.serviceName === "string" && args.config.serviceName !== "" ? args.config.serviceName : void 0;
2254
- const internalServiceFunctionPath = typeof serviceName === "string" && serviceName !== "" ? `/_svc/${serviceName}/index` : void 0;
2255
- const internalServiceOutputPath = internalServiceFunctionPath?.slice(1);
2254
+ const serviceFunctionPath = !!args.service?.name && !args.service.type ? "/index" : typeof serviceName === "string" && serviceName !== "" ? `/_svc/${serviceName}/index` : void 0;
2255
+ const serviceOutputPath = serviceFunctionPath?.slice(1);
2256
2256
  const remapRouteDestination = (route) => {
2257
2257
  const prefixedRoute = maybePrefixServiceRouteSource(route, serviceRoutePrefix);
2258
- if (!internalServiceFunctionPath || !route.dest) return prefixedRoute;
2258
+ if (!serviceFunctionPath || !route.dest) return prefixedRoute;
2259
2259
  return {
2260
2260
  ...prefixedRoute,
2261
- dest: internalServiceFunctionPath
2261
+ dest: serviceFunctionPath
2262
2262
  };
2263
2263
  };
2264
2264
  const routes = isCronService ? [{ handle: "filesystem" }] : [
@@ -2266,13 +2266,13 @@ const build = async (args) => {
2266
2266
  ...introspectionResult.routes.map(remapRouteDestination),
2267
2267
  {
2268
2268
  src: getServiceCatchallSource(serviceRoutePrefix),
2269
- dest: internalServiceFunctionPath ?? "/"
2269
+ dest: serviceFunctionPath ?? "/"
2270
2270
  }
2271
2271
  ];
2272
- const output = internalServiceOutputPath ? { [internalServiceOutputPath]: lambda } : { index: lambda };
2272
+ const output = serviceOutputPath ? { [serviceOutputPath]: lambda } : { index: lambda };
2273
2273
  for (const route of routes) if (route.dest) {
2274
2274
  if (route.dest === "/") continue;
2275
- const outputPath = route.dest === internalServiceFunctionPath && internalServiceOutputPath ? internalServiceOutputPath : route.dest;
2275
+ const outputPath = route.dest === serviceFunctionPath && serviceOutputPath ? serviceOutputPath : route.dest;
2276
2276
  output[outputPath] = lambda;
2277
2277
  }
2278
2278
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/backends",
3
- "version": "0.8.18",
3
+ "version": "0.8.19",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.mjs",
6
6
  "homepage": "https://vercel.com/docs",