@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.
- package/dist/index.mjs +7 -7
- 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
|
|
2255
|
-
const
|
|
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 (!
|
|
2258
|
+
if (!serviceFunctionPath || !route.dest) return prefixedRoute;
|
|
2259
2259
|
return {
|
|
2260
2260
|
...prefixedRoute,
|
|
2261
|
-
dest:
|
|
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:
|
|
2269
|
+
dest: serviceFunctionPath ?? "/"
|
|
2270
2270
|
}
|
|
2271
2271
|
];
|
|
2272
|
-
const output =
|
|
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 ===
|
|
2275
|
+
const outputPath = route.dest === serviceFunctionPath && serviceOutputPath ? serviceOutputPath : route.dest;
|
|
2276
2276
|
output[outputPath] = lambda;
|
|
2277
2277
|
}
|
|
2278
2278
|
return {
|