@next-community/adapter-vercel 0.0.1-beta.13 → 0.0.1-beta.15
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.js +38 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9548,6 +9548,36 @@ var writeIfNotExists = async (filePath, content) => {
|
|
|
9548
9548
|
writeLock.set(filePath, writePromise);
|
|
9549
9549
|
return writePromise;
|
|
9550
9550
|
};
|
|
9551
|
+
var vercelFunctionRegionsVar = process.env.VERCEL_FUNCTION_REGIONS;
|
|
9552
|
+
var vercelFunctionRegions;
|
|
9553
|
+
if (vercelFunctionRegionsVar) {
|
|
9554
|
+
vercelFunctionRegions = vercelFunctionRegionsVar.split(",");
|
|
9555
|
+
}
|
|
9556
|
+
function normalizeRegions(regions) {
|
|
9557
|
+
if (typeof regions === "string") {
|
|
9558
|
+
regions = [regions];
|
|
9559
|
+
}
|
|
9560
|
+
const newRegions = [];
|
|
9561
|
+
for (const region of regions) {
|
|
9562
|
+
if (region === "home") {
|
|
9563
|
+
if (vercelFunctionRegions) {
|
|
9564
|
+
newRegions.push(...vercelFunctionRegions);
|
|
9565
|
+
}
|
|
9566
|
+
continue;
|
|
9567
|
+
}
|
|
9568
|
+
if (region === "global") {
|
|
9569
|
+
return "all";
|
|
9570
|
+
}
|
|
9571
|
+
if (region === "auto") {
|
|
9572
|
+
return "auto";
|
|
9573
|
+
}
|
|
9574
|
+
newRegions.push(region);
|
|
9575
|
+
}
|
|
9576
|
+
if (newRegions.length === 0) {
|
|
9577
|
+
return void 0;
|
|
9578
|
+
}
|
|
9579
|
+
return newRegions;
|
|
9580
|
+
}
|
|
9551
9581
|
function normalizeIndexPathname(pathname, config) {
|
|
9552
9582
|
if (pathname === config.basePath && config.basePath !== "/") {
|
|
9553
9583
|
return import_node_path.default.posix.join(config.basePath, "/index");
|
|
@@ -9668,7 +9698,12 @@ async function handleNodeOutputs(nodeOutputs, {
|
|
|
9668
9698
|
prerenderFallbackFalseMap,
|
|
9669
9699
|
vercelOutputDir
|
|
9670
9700
|
}) {
|
|
9671
|
-
const nodeVersion = await (0, import_build_utils.getNodeVersion)(
|
|
9701
|
+
const nodeVersion = await (0, import_build_utils.getNodeVersion)(
|
|
9702
|
+
projectDir,
|
|
9703
|
+
void 0,
|
|
9704
|
+
vercelConfig,
|
|
9705
|
+
{}
|
|
9706
|
+
);
|
|
9672
9707
|
const fsSema = new import_async_sema.Sema(16, { capacity: nodeOutputs.length });
|
|
9673
9708
|
const functionsDir = import_node_path.default.join(vercelOutputDir, "functions");
|
|
9674
9709
|
const handlerRelativeDir = import_node_path.default.posix.relative(repoRoot, projectDir);
|
|
@@ -9932,7 +9967,6 @@ async function handlePrerenderOutputs(prerenderOutputs, {
|
|
|
9932
9967
|
}
|
|
9933
9968
|
async function handleEdgeOutputs(edgeOutputs, {
|
|
9934
9969
|
config,
|
|
9935
|
-
distDir,
|
|
9936
9970
|
repoRoot,
|
|
9937
9971
|
projectDir,
|
|
9938
9972
|
nextVersion,
|
|
@@ -10006,7 +10040,7 @@ async function handleEdgeOutputs(edgeOutputs, {
|
|
|
10006
10040
|
assets: nonJsAssetFiles,
|
|
10007
10041
|
deploymentTarget: "v8-worker",
|
|
10008
10042
|
environment: output.config.env || {},
|
|
10009
|
-
regions: output.config.preferredRegion,
|
|
10043
|
+
regions: output.config.preferredRegion ? normalizeRegions(output.config.preferredRegion) : void 0,
|
|
10010
10044
|
framework: {
|
|
10011
10045
|
slug: "nextjs",
|
|
10012
10046
|
version: nextVersion
|
|
@@ -10521,8 +10555,7 @@ var myAdapter = {
|
|
|
10521
10555
|
projectDir,
|
|
10522
10556
|
vercelOutputDir,
|
|
10523
10557
|
nextVersion,
|
|
10524
|
-
config
|
|
10525
|
-
distDir
|
|
10558
|
+
config
|
|
10526
10559
|
});
|
|
10527
10560
|
const prerenderFallbackFalseMap = {};
|
|
10528
10561
|
for (const prerender of outputs.prerenders) {
|