@vercel/next 4.12.1 → 4.12.3
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 +778 -626
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -128,7 +128,7 @@ var require_dist = __commonJS({
|
|
|
128
128
|
var result = [];
|
|
129
129
|
var key = 0;
|
|
130
130
|
var i = 0;
|
|
131
|
-
var
|
|
131
|
+
var path6 = "";
|
|
132
132
|
var tryConsume = function(type) {
|
|
133
133
|
if (i < tokens.length && tokens[i].type === type)
|
|
134
134
|
return tokens[i++].value;
|
|
@@ -155,12 +155,12 @@ var require_dist = __commonJS({
|
|
|
155
155
|
if (name || pattern) {
|
|
156
156
|
var prefix = char || "";
|
|
157
157
|
if (prefixes.indexOf(prefix) === -1) {
|
|
158
|
-
|
|
158
|
+
path6 += prefix;
|
|
159
159
|
prefix = "";
|
|
160
160
|
}
|
|
161
|
-
if (
|
|
162
|
-
result.push(
|
|
163
|
-
|
|
161
|
+
if (path6) {
|
|
162
|
+
result.push(path6);
|
|
163
|
+
path6 = "";
|
|
164
164
|
}
|
|
165
165
|
result.push({
|
|
166
166
|
name: name || key++,
|
|
@@ -173,12 +173,12 @@ var require_dist = __commonJS({
|
|
|
173
173
|
}
|
|
174
174
|
var value = char || tryConsume("ESCAPED_CHAR");
|
|
175
175
|
if (value) {
|
|
176
|
-
|
|
176
|
+
path6 += value;
|
|
177
177
|
continue;
|
|
178
178
|
}
|
|
179
|
-
if (
|
|
180
|
-
result.push(
|
|
181
|
-
|
|
179
|
+
if (path6) {
|
|
180
|
+
result.push(path6);
|
|
181
|
+
path6 = "";
|
|
182
182
|
}
|
|
183
183
|
var open = tryConsume("OPEN");
|
|
184
184
|
if (open) {
|
|
@@ -219,11 +219,11 @@ var require_dist = __commonJS({
|
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
return function(data) {
|
|
222
|
-
var
|
|
222
|
+
var path6 = "";
|
|
223
223
|
for (var i = 0; i < tokens.length; i++) {
|
|
224
224
|
var token = tokens[i];
|
|
225
225
|
if (typeof token === "string") {
|
|
226
|
-
|
|
226
|
+
path6 += token;
|
|
227
227
|
continue;
|
|
228
228
|
}
|
|
229
229
|
var value = data ? data[token.name] : void 0;
|
|
@@ -243,7 +243,7 @@ var require_dist = __commonJS({
|
|
|
243
243
|
if (validate && !matches[i].test(segment)) {
|
|
244
244
|
throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but got "' + segment + '"');
|
|
245
245
|
}
|
|
246
|
-
|
|
246
|
+
path6 += token.prefix + segment + token.suffix;
|
|
247
247
|
}
|
|
248
248
|
continue;
|
|
249
249
|
}
|
|
@@ -252,7 +252,7 @@ var require_dist = __commonJS({
|
|
|
252
252
|
if (validate && !matches[i].test(segment)) {
|
|
253
253
|
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but got "' + segment + '"');
|
|
254
254
|
}
|
|
255
|
-
|
|
255
|
+
path6 += token.prefix + segment + token.suffix;
|
|
256
256
|
continue;
|
|
257
257
|
}
|
|
258
258
|
if (optional)
|
|
@@ -260,7 +260,7 @@ var require_dist = __commonJS({
|
|
|
260
260
|
var typeOfMessage = repeat ? "an array" : "a string";
|
|
261
261
|
throw new TypeError('Expected "' + token.name + '" to be ' + typeOfMessage);
|
|
262
262
|
}
|
|
263
|
-
return
|
|
263
|
+
return path6;
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
266
|
exports.tokensToFunction = tokensToFunction;
|
|
@@ -281,7 +281,7 @@ var require_dist = __commonJS({
|
|
|
281
281
|
var m = re.exec(pathname);
|
|
282
282
|
if (!m)
|
|
283
283
|
return false;
|
|
284
|
-
var
|
|
284
|
+
var path6 = m[0], index = m.index;
|
|
285
285
|
var params = /* @__PURE__ */ Object.create(null);
|
|
286
286
|
var _loop_1 = function(i2) {
|
|
287
287
|
if (m[i2] === void 0)
|
|
@@ -298,7 +298,7 @@ var require_dist = __commonJS({
|
|
|
298
298
|
for (var i = 1; i < m.length; i++) {
|
|
299
299
|
_loop_1(i);
|
|
300
300
|
}
|
|
301
|
-
return { path:
|
|
301
|
+
return { path: path6, index, params };
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
304
|
exports.regexpToFunction = regexpToFunction;
|
|
@@ -308,10 +308,10 @@ var require_dist = __commonJS({
|
|
|
308
308
|
function flags(options) {
|
|
309
309
|
return options && options.sensitive ? "" : "i";
|
|
310
310
|
}
|
|
311
|
-
function regexpToRegexp(
|
|
311
|
+
function regexpToRegexp(path6, keys) {
|
|
312
312
|
if (!keys)
|
|
313
|
-
return
|
|
314
|
-
var groups =
|
|
313
|
+
return path6;
|
|
314
|
+
var groups = path6.source.match(/\((?!\?)/g);
|
|
315
315
|
if (groups) {
|
|
316
316
|
for (var i = 0; i < groups.length; i++) {
|
|
317
317
|
keys.push({
|
|
@@ -323,16 +323,16 @@ var require_dist = __commonJS({
|
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
return
|
|
326
|
+
return path6;
|
|
327
327
|
}
|
|
328
328
|
function arrayToRegexp(paths, keys, options) {
|
|
329
|
-
var parts = paths.map(function(
|
|
330
|
-
return pathToRegexp(
|
|
329
|
+
var parts = paths.map(function(path6) {
|
|
330
|
+
return pathToRegexp(path6, keys, options).source;
|
|
331
331
|
});
|
|
332
332
|
return new RegExp("(?:" + parts.join("|") + ")", flags(options));
|
|
333
333
|
}
|
|
334
|
-
function stringToRegexp(
|
|
335
|
-
return tokensToRegexp(parse(
|
|
334
|
+
function stringToRegexp(path6, keys, options) {
|
|
335
|
+
return tokensToRegexp(parse(path6, options), keys, options);
|
|
336
336
|
}
|
|
337
337
|
function tokensToRegexp(tokens, keys, options) {
|
|
338
338
|
if (options === void 0) {
|
|
@@ -389,12 +389,12 @@ var require_dist = __commonJS({
|
|
|
389
389
|
return new RegExp(route, flags(options));
|
|
390
390
|
}
|
|
391
391
|
exports.tokensToRegexp = tokensToRegexp;
|
|
392
|
-
function pathToRegexp(
|
|
393
|
-
if (
|
|
394
|
-
return regexpToRegexp(
|
|
395
|
-
if (Array.isArray(
|
|
396
|
-
return arrayToRegexp(
|
|
397
|
-
return stringToRegexp(
|
|
392
|
+
function pathToRegexp(path6, keys, options) {
|
|
393
|
+
if (path6 instanceof RegExp)
|
|
394
|
+
return regexpToRegexp(path6, keys);
|
|
395
|
+
if (Array.isArray(path6))
|
|
396
|
+
return arrayToRegexp(path6, keys, options);
|
|
397
|
+
return stringToRegexp(path6, keys, options);
|
|
398
398
|
}
|
|
399
399
|
exports.pathToRegexp = pathToRegexp;
|
|
400
400
|
}
|
|
@@ -498,7 +498,7 @@ var require_dist2 = __commonJS({
|
|
|
498
498
|
var result = [];
|
|
499
499
|
var key = 0;
|
|
500
500
|
var i = 0;
|
|
501
|
-
var
|
|
501
|
+
var path6 = "";
|
|
502
502
|
var tryConsume = function(type) {
|
|
503
503
|
if (i < tokens.length && tokens[i].type === type)
|
|
504
504
|
return tokens[i++].value;
|
|
@@ -543,12 +543,12 @@ var require_dist2 = __commonJS({
|
|
|
543
543
|
if (name || pattern) {
|
|
544
544
|
var prefix = char || "";
|
|
545
545
|
if (prefixes.indexOf(prefix) === -1) {
|
|
546
|
-
|
|
546
|
+
path6 += prefix;
|
|
547
547
|
prefix = "";
|
|
548
548
|
}
|
|
549
|
-
if (
|
|
550
|
-
result.push(
|
|
551
|
-
|
|
549
|
+
if (path6) {
|
|
550
|
+
result.push(path6);
|
|
551
|
+
path6 = "";
|
|
552
552
|
}
|
|
553
553
|
result.push({
|
|
554
554
|
name: name || key++,
|
|
@@ -561,12 +561,12 @@ var require_dist2 = __commonJS({
|
|
|
561
561
|
}
|
|
562
562
|
var value = char || tryConsume("ESCAPED_CHAR");
|
|
563
563
|
if (value) {
|
|
564
|
-
|
|
564
|
+
path6 += value;
|
|
565
565
|
continue;
|
|
566
566
|
}
|
|
567
|
-
if (
|
|
568
|
-
result.push(
|
|
569
|
-
|
|
567
|
+
if (path6) {
|
|
568
|
+
result.push(path6);
|
|
569
|
+
path6 = "";
|
|
570
570
|
}
|
|
571
571
|
var open = tryConsume("OPEN");
|
|
572
572
|
if (open) {
|
|
@@ -607,11 +607,11 @@ var require_dist2 = __commonJS({
|
|
|
607
607
|
}
|
|
608
608
|
});
|
|
609
609
|
return function(data) {
|
|
610
|
-
var
|
|
610
|
+
var path6 = "";
|
|
611
611
|
for (var i = 0; i < tokens.length; i++) {
|
|
612
612
|
var token = tokens[i];
|
|
613
613
|
if (typeof token === "string") {
|
|
614
|
-
|
|
614
|
+
path6 += token;
|
|
615
615
|
continue;
|
|
616
616
|
}
|
|
617
617
|
var value = data ? data[token.name] : void 0;
|
|
@@ -631,7 +631,7 @@ var require_dist2 = __commonJS({
|
|
|
631
631
|
if (validate && !matches[i].test(segment)) {
|
|
632
632
|
throw new TypeError('Expected all "'.concat(token.name, '" to match "').concat(token.pattern, '", but got "').concat(segment, '"'));
|
|
633
633
|
}
|
|
634
|
-
|
|
634
|
+
path6 += token.prefix + segment + token.suffix;
|
|
635
635
|
}
|
|
636
636
|
continue;
|
|
637
637
|
}
|
|
@@ -640,7 +640,7 @@ var require_dist2 = __commonJS({
|
|
|
640
640
|
if (validate && !matches[i].test(segment)) {
|
|
641
641
|
throw new TypeError('Expected "'.concat(token.name, '" to match "').concat(token.pattern, '", but got "').concat(segment, '"'));
|
|
642
642
|
}
|
|
643
|
-
|
|
643
|
+
path6 += token.prefix + segment + token.suffix;
|
|
644
644
|
continue;
|
|
645
645
|
}
|
|
646
646
|
if (optional)
|
|
@@ -648,7 +648,7 @@ var require_dist2 = __commonJS({
|
|
|
648
648
|
var typeOfMessage = repeat ? "an array" : "a string";
|
|
649
649
|
throw new TypeError('Expected "'.concat(token.name, '" to be ').concat(typeOfMessage));
|
|
650
650
|
}
|
|
651
|
-
return
|
|
651
|
+
return path6;
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
654
|
exports.tokensToFunction = tokensToFunction;
|
|
@@ -669,7 +669,7 @@ var require_dist2 = __commonJS({
|
|
|
669
669
|
var m = re.exec(pathname);
|
|
670
670
|
if (!m)
|
|
671
671
|
return false;
|
|
672
|
-
var
|
|
672
|
+
var path6 = m[0], index = m.index;
|
|
673
673
|
var params = /* @__PURE__ */ Object.create(null);
|
|
674
674
|
var _loop_1 = function(i2) {
|
|
675
675
|
if (m[i2] === void 0)
|
|
@@ -686,7 +686,7 @@ var require_dist2 = __commonJS({
|
|
|
686
686
|
for (var i = 1; i < m.length; i++) {
|
|
687
687
|
_loop_1(i);
|
|
688
688
|
}
|
|
689
|
-
return { path:
|
|
689
|
+
return { path: path6, index, params };
|
|
690
690
|
};
|
|
691
691
|
}
|
|
692
692
|
exports.regexpToFunction = regexpToFunction;
|
|
@@ -696,12 +696,12 @@ var require_dist2 = __commonJS({
|
|
|
696
696
|
function flags(options) {
|
|
697
697
|
return options && options.sensitive ? "" : "i";
|
|
698
698
|
}
|
|
699
|
-
function regexpToRegexp(
|
|
699
|
+
function regexpToRegexp(path6, keys) {
|
|
700
700
|
if (!keys)
|
|
701
|
-
return
|
|
701
|
+
return path6;
|
|
702
702
|
var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g;
|
|
703
703
|
var index = 0;
|
|
704
|
-
var execResult = groupsRegex.exec(
|
|
704
|
+
var execResult = groupsRegex.exec(path6.source);
|
|
705
705
|
while (execResult) {
|
|
706
706
|
keys.push({
|
|
707
707
|
// Use parenthesized substring match if available, index otherwise
|
|
@@ -711,18 +711,18 @@ var require_dist2 = __commonJS({
|
|
|
711
711
|
modifier: "",
|
|
712
712
|
pattern: ""
|
|
713
713
|
});
|
|
714
|
-
execResult = groupsRegex.exec(
|
|
714
|
+
execResult = groupsRegex.exec(path6.source);
|
|
715
715
|
}
|
|
716
|
-
return
|
|
716
|
+
return path6;
|
|
717
717
|
}
|
|
718
718
|
function arrayToRegexp(paths, keys, options) {
|
|
719
|
-
var parts = paths.map(function(
|
|
720
|
-
return pathToRegexp(
|
|
719
|
+
var parts = paths.map(function(path6) {
|
|
720
|
+
return pathToRegexp(path6, keys, options).source;
|
|
721
721
|
});
|
|
722
722
|
return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options));
|
|
723
723
|
}
|
|
724
|
-
function stringToRegexp(
|
|
725
|
-
return tokensToRegexp(parse(
|
|
724
|
+
function stringToRegexp(path6, keys, options) {
|
|
725
|
+
return tokensToRegexp(parse(path6, options), keys, options);
|
|
726
726
|
}
|
|
727
727
|
function tokensToRegexp(tokens, keys, options) {
|
|
728
728
|
if (options === void 0) {
|
|
@@ -779,12 +779,12 @@ var require_dist2 = __commonJS({
|
|
|
779
779
|
return new RegExp(route, flags(options));
|
|
780
780
|
}
|
|
781
781
|
exports.tokensToRegexp = tokensToRegexp;
|
|
782
|
-
function pathToRegexp(
|
|
783
|
-
if (
|
|
784
|
-
return regexpToRegexp(
|
|
785
|
-
if (Array.isArray(
|
|
786
|
-
return arrayToRegexp(
|
|
787
|
-
return stringToRegexp(
|
|
782
|
+
function pathToRegexp(path6, keys, options) {
|
|
783
|
+
if (path6 instanceof RegExp)
|
|
784
|
+
return regexpToRegexp(path6, keys);
|
|
785
|
+
if (Array.isArray(path6))
|
|
786
|
+
return arrayToRegexp(path6, keys, options);
|
|
787
|
+
return stringToRegexp(path6, keys, options);
|
|
788
788
|
}
|
|
789
789
|
exports.pathToRegexp = pathToRegexp;
|
|
790
790
|
}
|
|
@@ -838,16 +838,16 @@ var require_superstatic = __commonJS({
|
|
|
838
838
|
const rightSerialized = typeof right === "undefined" ? "undefined" : right.toString();
|
|
839
839
|
return leftSerialized === rightSerialized;
|
|
840
840
|
}
|
|
841
|
-
function pathToRegexp(callerId,
|
|
841
|
+
function pathToRegexp(callerId, path6, keys, options) {
|
|
842
842
|
const newKeys = cloneKeys(keys);
|
|
843
|
-
const currentRegExp = (0, import_path_to_regexp.pathToRegexp)(
|
|
843
|
+
const currentRegExp = (0, import_path_to_regexp.pathToRegexp)(path6, keys, options);
|
|
844
844
|
try {
|
|
845
845
|
const currentKeys = keys;
|
|
846
|
-
const newRegExp = (0, import_path_to_regexp_updated.pathToRegexp)(
|
|
846
|
+
const newRegExp = (0, import_path_to_regexp_updated.pathToRegexp)(path6, newKeys, options);
|
|
847
847
|
const isDiffRegExp = currentRegExp.toString() !== newRegExp.toString();
|
|
848
848
|
if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffRegExp) {
|
|
849
849
|
const message = JSON.stringify({
|
|
850
|
-
path:
|
|
850
|
+
path: path6,
|
|
851
851
|
currentRegExp: currentRegExp.toString(),
|
|
852
852
|
newRegExp: newRegExp.toString()
|
|
853
853
|
});
|
|
@@ -865,7 +865,7 @@ var require_superstatic = __commonJS({
|
|
|
865
865
|
} catch (err) {
|
|
866
866
|
const error = err;
|
|
867
867
|
const message = JSON.stringify({
|
|
868
|
-
path:
|
|
868
|
+
path: path6,
|
|
869
869
|
error: error.message
|
|
870
870
|
});
|
|
871
871
|
console.error(`[vc] PATH TO REGEXP ERROR @ #${callerId}: ${message}`);
|
|
@@ -1481,7 +1481,7 @@ var require_p_locate = __commonJS({
|
|
|
1481
1481
|
var require_locate_path = __commonJS({
|
|
1482
1482
|
"../../node_modules/.pnpm/locate-path@5.0.0/node_modules/locate-path/index.js"(exports, module2) {
|
|
1483
1483
|
"use strict";
|
|
1484
|
-
var
|
|
1484
|
+
var path6 = require("path");
|
|
1485
1485
|
var fs5 = require("fs");
|
|
1486
1486
|
var { promisify: promisify2 } = require("util");
|
|
1487
1487
|
var pLocate = require_p_locate();
|
|
@@ -1509,7 +1509,7 @@ var require_locate_path = __commonJS({
|
|
|
1509
1509
|
const statFn = options.allowSymlinks ? fsStat : fsLStat;
|
|
1510
1510
|
return pLocate(paths, async (path_) => {
|
|
1511
1511
|
try {
|
|
1512
|
-
const stat2 = await statFn(
|
|
1512
|
+
const stat2 = await statFn(path6.resolve(options.cwd, path_));
|
|
1513
1513
|
return matchType(options.type, stat2);
|
|
1514
1514
|
} catch (_) {
|
|
1515
1515
|
return false;
|
|
@@ -1527,7 +1527,7 @@ var require_locate_path = __commonJS({
|
|
|
1527
1527
|
const statFn = options.allowSymlinks ? fs5.statSync : fs5.lstatSync;
|
|
1528
1528
|
for (const path_ of paths) {
|
|
1529
1529
|
try {
|
|
1530
|
-
const stat2 = statFn(
|
|
1530
|
+
const stat2 = statFn(path6.resolve(options.cwd, path_));
|
|
1531
1531
|
if (matchType(options.type, stat2)) {
|
|
1532
1532
|
return path_;
|
|
1533
1533
|
}
|
|
@@ -1545,17 +1545,17 @@ var require_path_exists = __commonJS({
|
|
|
1545
1545
|
var fs5 = require("fs");
|
|
1546
1546
|
var { promisify: promisify2 } = require("util");
|
|
1547
1547
|
var pAccess = promisify2(fs5.access);
|
|
1548
|
-
module2.exports = async (
|
|
1548
|
+
module2.exports = async (path6) => {
|
|
1549
1549
|
try {
|
|
1550
|
-
await pAccess(
|
|
1550
|
+
await pAccess(path6);
|
|
1551
1551
|
return true;
|
|
1552
1552
|
} catch (_) {
|
|
1553
1553
|
return false;
|
|
1554
1554
|
}
|
|
1555
1555
|
};
|
|
1556
|
-
module2.exports.sync = (
|
|
1556
|
+
module2.exports.sync = (path6) => {
|
|
1557
1557
|
try {
|
|
1558
|
-
fs5.accessSync(
|
|
1558
|
+
fs5.accessSync(path6);
|
|
1559
1559
|
return true;
|
|
1560
1560
|
} catch (_) {
|
|
1561
1561
|
return false;
|
|
@@ -1568,13 +1568,13 @@ var require_path_exists = __commonJS({
|
|
|
1568
1568
|
var require_find_up = __commonJS({
|
|
1569
1569
|
"../../node_modules/.pnpm/find-up@4.1.0/node_modules/find-up/index.js"(exports, module2) {
|
|
1570
1570
|
"use strict";
|
|
1571
|
-
var
|
|
1571
|
+
var path6 = require("path");
|
|
1572
1572
|
var locatePath = require_locate_path();
|
|
1573
1573
|
var pathExists2 = require_path_exists();
|
|
1574
1574
|
var stop = Symbol("findUp.stop");
|
|
1575
1575
|
module2.exports = async (name, options = {}) => {
|
|
1576
|
-
let directory =
|
|
1577
|
-
const { root } =
|
|
1576
|
+
let directory = path6.resolve(options.cwd || "");
|
|
1577
|
+
const { root } = path6.parse(directory);
|
|
1578
1578
|
const paths = [].concat(name);
|
|
1579
1579
|
const runMatcher = async (locateOptions) => {
|
|
1580
1580
|
if (typeof name !== "function") {
|
|
@@ -1592,17 +1592,17 @@ var require_find_up = __commonJS({
|
|
|
1592
1592
|
return;
|
|
1593
1593
|
}
|
|
1594
1594
|
if (foundPath) {
|
|
1595
|
-
return
|
|
1595
|
+
return path6.resolve(directory, foundPath);
|
|
1596
1596
|
}
|
|
1597
1597
|
if (directory === root) {
|
|
1598
1598
|
return;
|
|
1599
1599
|
}
|
|
1600
|
-
directory =
|
|
1600
|
+
directory = path6.dirname(directory);
|
|
1601
1601
|
}
|
|
1602
1602
|
};
|
|
1603
1603
|
module2.exports.sync = (name, options = {}) => {
|
|
1604
|
-
let directory =
|
|
1605
|
-
const { root } =
|
|
1604
|
+
let directory = path6.resolve(options.cwd || "");
|
|
1605
|
+
const { root } = path6.parse(directory);
|
|
1606
1606
|
const paths = [].concat(name);
|
|
1607
1607
|
const runMatcher = (locateOptions) => {
|
|
1608
1608
|
if (typeof name !== "function") {
|
|
@@ -1620,12 +1620,12 @@ var require_find_up = __commonJS({
|
|
|
1620
1620
|
return;
|
|
1621
1621
|
}
|
|
1622
1622
|
if (foundPath) {
|
|
1623
|
-
return
|
|
1623
|
+
return path6.resolve(directory, foundPath);
|
|
1624
1624
|
}
|
|
1625
1625
|
if (directory === root) {
|
|
1626
1626
|
return;
|
|
1627
1627
|
}
|
|
1628
|
-
directory =
|
|
1628
|
+
directory = path6.dirname(directory);
|
|
1629
1629
|
}
|
|
1630
1630
|
};
|
|
1631
1631
|
module2.exports.exists = pathExists2;
|
|
@@ -1717,7 +1717,7 @@ var require_polyfills = __commonJS({
|
|
|
1717
1717
|
fs5.fstatSync = statFixSync(fs5.fstatSync);
|
|
1718
1718
|
fs5.lstatSync = statFixSync(fs5.lstatSync);
|
|
1719
1719
|
if (fs5.chmod && !fs5.lchmod) {
|
|
1720
|
-
fs5.lchmod = function(
|
|
1720
|
+
fs5.lchmod = function(path6, mode, cb) {
|
|
1721
1721
|
if (cb)
|
|
1722
1722
|
process.nextTick(cb);
|
|
1723
1723
|
};
|
|
@@ -1725,7 +1725,7 @@ var require_polyfills = __commonJS({
|
|
|
1725
1725
|
};
|
|
1726
1726
|
}
|
|
1727
1727
|
if (fs5.chown && !fs5.lchown) {
|
|
1728
|
-
fs5.lchown = function(
|
|
1728
|
+
fs5.lchown = function(path6, uid, gid, cb) {
|
|
1729
1729
|
if (cb)
|
|
1730
1730
|
process.nextTick(cb);
|
|
1731
1731
|
};
|
|
@@ -1796,9 +1796,9 @@ var require_polyfills = __commonJS({
|
|
|
1796
1796
|
};
|
|
1797
1797
|
}(fs5.readSync);
|
|
1798
1798
|
function patchLchmod(fs6) {
|
|
1799
|
-
fs6.lchmod = function(
|
|
1799
|
+
fs6.lchmod = function(path6, mode, callback) {
|
|
1800
1800
|
fs6.open(
|
|
1801
|
-
|
|
1801
|
+
path6,
|
|
1802
1802
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
1803
1803
|
mode,
|
|
1804
1804
|
function(err, fd) {
|
|
@@ -1816,8 +1816,8 @@ var require_polyfills = __commonJS({
|
|
|
1816
1816
|
}
|
|
1817
1817
|
);
|
|
1818
1818
|
};
|
|
1819
|
-
fs6.lchmodSync = function(
|
|
1820
|
-
var fd = fs6.openSync(
|
|
1819
|
+
fs6.lchmodSync = function(path6, mode) {
|
|
1820
|
+
var fd = fs6.openSync(path6, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
1821
1821
|
var threw = true;
|
|
1822
1822
|
var ret;
|
|
1823
1823
|
try {
|
|
@@ -1838,8 +1838,8 @@ var require_polyfills = __commonJS({
|
|
|
1838
1838
|
}
|
|
1839
1839
|
function patchLutimes(fs6) {
|
|
1840
1840
|
if (constants.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
|
|
1841
|
-
fs6.lutimes = function(
|
|
1842
|
-
fs6.open(
|
|
1841
|
+
fs6.lutimes = function(path6, at, mt, cb) {
|
|
1842
|
+
fs6.open(path6, constants.O_SYMLINK, function(er, fd) {
|
|
1843
1843
|
if (er) {
|
|
1844
1844
|
if (cb)
|
|
1845
1845
|
cb(er);
|
|
@@ -1853,8 +1853,8 @@ var require_polyfills = __commonJS({
|
|
|
1853
1853
|
});
|
|
1854
1854
|
});
|
|
1855
1855
|
};
|
|
1856
|
-
fs6.lutimesSync = function(
|
|
1857
|
-
var fd = fs6.openSync(
|
|
1856
|
+
fs6.lutimesSync = function(path6, at, mt) {
|
|
1857
|
+
var fd = fs6.openSync(path6, constants.O_SYMLINK);
|
|
1858
1858
|
var ret;
|
|
1859
1859
|
var threw = true;
|
|
1860
1860
|
try {
|
|
@@ -1990,12 +1990,12 @@ var require_legacy_streams = __commonJS({
|
|
|
1990
1990
|
ReadStream,
|
|
1991
1991
|
WriteStream
|
|
1992
1992
|
};
|
|
1993
|
-
function ReadStream(
|
|
1993
|
+
function ReadStream(path6, options) {
|
|
1994
1994
|
if (!(this instanceof ReadStream))
|
|
1995
|
-
return new ReadStream(
|
|
1995
|
+
return new ReadStream(path6, options);
|
|
1996
1996
|
Stream.call(this);
|
|
1997
1997
|
var self = this;
|
|
1998
|
-
this.path =
|
|
1998
|
+
this.path = path6;
|
|
1999
1999
|
this.fd = null;
|
|
2000
2000
|
this.readable = true;
|
|
2001
2001
|
this.paused = false;
|
|
@@ -2041,11 +2041,11 @@ var require_legacy_streams = __commonJS({
|
|
|
2041
2041
|
self._read();
|
|
2042
2042
|
});
|
|
2043
2043
|
}
|
|
2044
|
-
function WriteStream(
|
|
2044
|
+
function WriteStream(path6, options) {
|
|
2045
2045
|
if (!(this instanceof WriteStream))
|
|
2046
|
-
return new WriteStream(
|
|
2046
|
+
return new WriteStream(path6, options);
|
|
2047
2047
|
Stream.call(this);
|
|
2048
|
-
this.path =
|
|
2048
|
+
this.path = path6;
|
|
2049
2049
|
this.fd = null;
|
|
2050
2050
|
this.writable = true;
|
|
2051
2051
|
this.flags = "w";
|
|
@@ -2188,14 +2188,14 @@ var require_graceful_fs = __commonJS({
|
|
|
2188
2188
|
fs6.createWriteStream = createWriteStream;
|
|
2189
2189
|
var fs$readFile = fs6.readFile;
|
|
2190
2190
|
fs6.readFile = readFile3;
|
|
2191
|
-
function readFile3(
|
|
2191
|
+
function readFile3(path6, options, cb) {
|
|
2192
2192
|
if (typeof options === "function")
|
|
2193
2193
|
cb = options, options = null;
|
|
2194
|
-
return go$readFile(
|
|
2195
|
-
function go$readFile(
|
|
2196
|
-
return fs$readFile(
|
|
2194
|
+
return go$readFile(path6, options, cb);
|
|
2195
|
+
function go$readFile(path7, options2, cb2, startTime) {
|
|
2196
|
+
return fs$readFile(path7, options2, function(err) {
|
|
2197
2197
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2198
|
-
enqueue([go$readFile, [
|
|
2198
|
+
enqueue([go$readFile, [path7, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2199
2199
|
else {
|
|
2200
2200
|
if (typeof cb2 === "function")
|
|
2201
2201
|
cb2.apply(this, arguments);
|
|
@@ -2205,14 +2205,14 @@ var require_graceful_fs = __commonJS({
|
|
|
2205
2205
|
}
|
|
2206
2206
|
var fs$writeFile = fs6.writeFile;
|
|
2207
2207
|
fs6.writeFile = writeFile2;
|
|
2208
|
-
function writeFile2(
|
|
2208
|
+
function writeFile2(path6, data, options, cb) {
|
|
2209
2209
|
if (typeof options === "function")
|
|
2210
2210
|
cb = options, options = null;
|
|
2211
|
-
return go$writeFile(
|
|
2212
|
-
function go$writeFile(
|
|
2213
|
-
return fs$writeFile(
|
|
2211
|
+
return go$writeFile(path6, data, options, cb);
|
|
2212
|
+
function go$writeFile(path7, data2, options2, cb2, startTime) {
|
|
2213
|
+
return fs$writeFile(path7, data2, options2, function(err) {
|
|
2214
2214
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2215
|
-
enqueue([go$writeFile, [
|
|
2215
|
+
enqueue([go$writeFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2216
2216
|
else {
|
|
2217
2217
|
if (typeof cb2 === "function")
|
|
2218
2218
|
cb2.apply(this, arguments);
|
|
@@ -2223,14 +2223,14 @@ var require_graceful_fs = __commonJS({
|
|
|
2223
2223
|
var fs$appendFile = fs6.appendFile;
|
|
2224
2224
|
if (fs$appendFile)
|
|
2225
2225
|
fs6.appendFile = appendFile;
|
|
2226
|
-
function appendFile(
|
|
2226
|
+
function appendFile(path6, data, options, cb) {
|
|
2227
2227
|
if (typeof options === "function")
|
|
2228
2228
|
cb = options, options = null;
|
|
2229
|
-
return go$appendFile(
|
|
2230
|
-
function go$appendFile(
|
|
2231
|
-
return fs$appendFile(
|
|
2229
|
+
return go$appendFile(path6, data, options, cb);
|
|
2230
|
+
function go$appendFile(path7, data2, options2, cb2, startTime) {
|
|
2231
|
+
return fs$appendFile(path7, data2, options2, function(err) {
|
|
2232
2232
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2233
|
-
enqueue([go$appendFile, [
|
|
2233
|
+
enqueue([go$appendFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2234
2234
|
else {
|
|
2235
2235
|
if (typeof cb2 === "function")
|
|
2236
2236
|
cb2.apply(this, arguments);
|
|
@@ -2261,31 +2261,31 @@ var require_graceful_fs = __commonJS({
|
|
|
2261
2261
|
var fs$readdir = fs6.readdir;
|
|
2262
2262
|
fs6.readdir = readdir;
|
|
2263
2263
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
2264
|
-
function readdir(
|
|
2264
|
+
function readdir(path6, options, cb) {
|
|
2265
2265
|
if (typeof options === "function")
|
|
2266
2266
|
cb = options, options = null;
|
|
2267
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
2268
|
-
return fs$readdir(
|
|
2269
|
-
|
|
2267
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path7, options2, cb2, startTime) {
|
|
2268
|
+
return fs$readdir(path7, fs$readdirCallback(
|
|
2269
|
+
path7,
|
|
2270
2270
|
options2,
|
|
2271
2271
|
cb2,
|
|
2272
2272
|
startTime
|
|
2273
2273
|
));
|
|
2274
|
-
} : function go$readdir2(
|
|
2275
|
-
return fs$readdir(
|
|
2276
|
-
|
|
2274
|
+
} : function go$readdir2(path7, options2, cb2, startTime) {
|
|
2275
|
+
return fs$readdir(path7, options2, fs$readdirCallback(
|
|
2276
|
+
path7,
|
|
2277
2277
|
options2,
|
|
2278
2278
|
cb2,
|
|
2279
2279
|
startTime
|
|
2280
2280
|
));
|
|
2281
2281
|
};
|
|
2282
|
-
return go$readdir(
|
|
2283
|
-
function fs$readdirCallback(
|
|
2282
|
+
return go$readdir(path6, options, cb);
|
|
2283
|
+
function fs$readdirCallback(path7, options2, cb2, startTime) {
|
|
2284
2284
|
return function(err, files) {
|
|
2285
2285
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2286
2286
|
enqueue([
|
|
2287
2287
|
go$readdir,
|
|
2288
|
-
[
|
|
2288
|
+
[path7, options2, cb2],
|
|
2289
2289
|
err,
|
|
2290
2290
|
startTime || Date.now(),
|
|
2291
2291
|
Date.now()
|
|
@@ -2356,7 +2356,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2356
2356
|
enumerable: true,
|
|
2357
2357
|
configurable: true
|
|
2358
2358
|
});
|
|
2359
|
-
function ReadStream(
|
|
2359
|
+
function ReadStream(path6, options) {
|
|
2360
2360
|
if (this instanceof ReadStream)
|
|
2361
2361
|
return fs$ReadStream.apply(this, arguments), this;
|
|
2362
2362
|
else
|
|
@@ -2376,7 +2376,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2376
2376
|
}
|
|
2377
2377
|
});
|
|
2378
2378
|
}
|
|
2379
|
-
function WriteStream(
|
|
2379
|
+
function WriteStream(path6, options) {
|
|
2380
2380
|
if (this instanceof WriteStream)
|
|
2381
2381
|
return fs$WriteStream.apply(this, arguments), this;
|
|
2382
2382
|
else
|
|
@@ -2394,22 +2394,22 @@ var require_graceful_fs = __commonJS({
|
|
|
2394
2394
|
}
|
|
2395
2395
|
});
|
|
2396
2396
|
}
|
|
2397
|
-
function createReadStream(
|
|
2398
|
-
return new fs6.ReadStream(
|
|
2397
|
+
function createReadStream(path6, options) {
|
|
2398
|
+
return new fs6.ReadStream(path6, options);
|
|
2399
2399
|
}
|
|
2400
|
-
function createWriteStream(
|
|
2401
|
-
return new fs6.WriteStream(
|
|
2400
|
+
function createWriteStream(path6, options) {
|
|
2401
|
+
return new fs6.WriteStream(path6, options);
|
|
2402
2402
|
}
|
|
2403
2403
|
var fs$open = fs6.open;
|
|
2404
2404
|
fs6.open = open;
|
|
2405
|
-
function open(
|
|
2405
|
+
function open(path6, flags, mode, cb) {
|
|
2406
2406
|
if (typeof mode === "function")
|
|
2407
2407
|
cb = mode, mode = null;
|
|
2408
|
-
return go$open(
|
|
2409
|
-
function go$open(
|
|
2410
|
-
return fs$open(
|
|
2408
|
+
return go$open(path6, flags, mode, cb);
|
|
2409
|
+
function go$open(path7, flags2, mode2, cb2, startTime) {
|
|
2410
|
+
return fs$open(path7, flags2, mode2, function(err, fd) {
|
|
2411
2411
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2412
|
-
enqueue([go$open, [
|
|
2412
|
+
enqueue([go$open, [path7, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2413
2413
|
else {
|
|
2414
2414
|
if (typeof cb2 === "function")
|
|
2415
2415
|
cb2.apply(this, arguments);
|
|
@@ -2592,10 +2592,10 @@ var require_fs = __commonJS({
|
|
|
2592
2592
|
var require_utils = __commonJS({
|
|
2593
2593
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
|
|
2594
2594
|
"use strict";
|
|
2595
|
-
var
|
|
2595
|
+
var path6 = require("path");
|
|
2596
2596
|
module2.exports.checkPath = function checkPath(pth) {
|
|
2597
2597
|
if (process.platform === "win32") {
|
|
2598
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
2598
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path6.parse(pth).root, ""));
|
|
2599
2599
|
if (pathHasInvalidWinCharacters) {
|
|
2600
2600
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
2601
2601
|
error.code = "EINVAL";
|
|
@@ -2660,8 +2660,8 @@ var require_path_exists2 = __commonJS({
|
|
|
2660
2660
|
"use strict";
|
|
2661
2661
|
var u = require_universalify().fromPromise;
|
|
2662
2662
|
var fs5 = require_fs();
|
|
2663
|
-
function pathExists2(
|
|
2664
|
-
return fs5.access(
|
|
2663
|
+
function pathExists2(path6) {
|
|
2664
|
+
return fs5.access(path6).then(() => true).catch(() => false);
|
|
2665
2665
|
}
|
|
2666
2666
|
module2.exports = {
|
|
2667
2667
|
pathExists: u(pathExists2),
|
|
@@ -2676,8 +2676,8 @@ var require_utimes = __commonJS({
|
|
|
2676
2676
|
"use strict";
|
|
2677
2677
|
var fs5 = require_fs();
|
|
2678
2678
|
var u = require_universalify().fromPromise;
|
|
2679
|
-
async function utimesMillis(
|
|
2680
|
-
const fd = await fs5.open(
|
|
2679
|
+
async function utimesMillis(path6, atime, mtime) {
|
|
2680
|
+
const fd = await fs5.open(path6, "r+");
|
|
2681
2681
|
let closeErr = null;
|
|
2682
2682
|
try {
|
|
2683
2683
|
await fs5.futimes(fd, atime, mtime);
|
|
@@ -2692,8 +2692,8 @@ var require_utimes = __commonJS({
|
|
|
2692
2692
|
throw closeErr;
|
|
2693
2693
|
}
|
|
2694
2694
|
}
|
|
2695
|
-
function utimesMillisSync(
|
|
2696
|
-
const fd = fs5.openSync(
|
|
2695
|
+
function utimesMillisSync(path6, atime, mtime) {
|
|
2696
|
+
const fd = fs5.openSync(path6, "r+");
|
|
2697
2697
|
fs5.futimesSync(fd, atime, mtime);
|
|
2698
2698
|
return fs5.closeSync(fd);
|
|
2699
2699
|
}
|
|
@@ -2709,7 +2709,7 @@ var require_stat = __commonJS({
|
|
|
2709
2709
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
|
|
2710
2710
|
"use strict";
|
|
2711
2711
|
var fs5 = require_fs();
|
|
2712
|
-
var
|
|
2712
|
+
var path6 = require("path");
|
|
2713
2713
|
var u = require_universalify().fromPromise;
|
|
2714
2714
|
function getStats(src, dest, opts) {
|
|
2715
2715
|
const statFunc = opts.dereference ? (file) => fs5.stat(file, { bigint: true }) : (file) => fs5.lstat(file, { bigint: true });
|
|
@@ -2739,8 +2739,8 @@ var require_stat = __commonJS({
|
|
|
2739
2739
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
2740
2740
|
if (destStat) {
|
|
2741
2741
|
if (areIdentical(srcStat, destStat)) {
|
|
2742
|
-
const srcBaseName =
|
|
2743
|
-
const destBaseName =
|
|
2742
|
+
const srcBaseName = path6.basename(src);
|
|
2743
|
+
const destBaseName = path6.basename(dest);
|
|
2744
2744
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
2745
2745
|
return { srcStat, destStat, isChangingCase: true };
|
|
2746
2746
|
}
|
|
@@ -2762,8 +2762,8 @@ var require_stat = __commonJS({
|
|
|
2762
2762
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
2763
2763
|
if (destStat) {
|
|
2764
2764
|
if (areIdentical(srcStat, destStat)) {
|
|
2765
|
-
const srcBaseName =
|
|
2766
|
-
const destBaseName =
|
|
2765
|
+
const srcBaseName = path6.basename(src);
|
|
2766
|
+
const destBaseName = path6.basename(dest);
|
|
2767
2767
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
2768
2768
|
return { srcStat, destStat, isChangingCase: true };
|
|
2769
2769
|
}
|
|
@@ -2782,9 +2782,9 @@ var require_stat = __commonJS({
|
|
|
2782
2782
|
return { srcStat, destStat };
|
|
2783
2783
|
}
|
|
2784
2784
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
2785
|
-
const srcParent =
|
|
2786
|
-
const destParent =
|
|
2787
|
-
if (destParent === srcParent || destParent ===
|
|
2785
|
+
const srcParent = path6.resolve(path6.dirname(src));
|
|
2786
|
+
const destParent = path6.resolve(path6.dirname(dest));
|
|
2787
|
+
if (destParent === srcParent || destParent === path6.parse(destParent).root)
|
|
2788
2788
|
return;
|
|
2789
2789
|
let destStat;
|
|
2790
2790
|
try {
|
|
@@ -2800,9 +2800,9 @@ var require_stat = __commonJS({
|
|
|
2800
2800
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
2801
2801
|
}
|
|
2802
2802
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
2803
|
-
const srcParent =
|
|
2804
|
-
const destParent =
|
|
2805
|
-
if (destParent === srcParent || destParent ===
|
|
2803
|
+
const srcParent = path6.resolve(path6.dirname(src));
|
|
2804
|
+
const destParent = path6.resolve(path6.dirname(dest));
|
|
2805
|
+
if (destParent === srcParent || destParent === path6.parse(destParent).root)
|
|
2806
2806
|
return;
|
|
2807
2807
|
let destStat;
|
|
2808
2808
|
try {
|
|
@@ -2821,8 +2821,8 @@ var require_stat = __commonJS({
|
|
|
2821
2821
|
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
2822
2822
|
}
|
|
2823
2823
|
function isSrcSubdir(src, dest) {
|
|
2824
|
-
const srcArr =
|
|
2825
|
-
const destArr =
|
|
2824
|
+
const srcArr = path6.resolve(src).split(path6.sep).filter((i) => i);
|
|
2825
|
+
const destArr = path6.resolve(dest).split(path6.sep).filter((i) => i);
|
|
2826
2826
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
2827
2827
|
}
|
|
2828
2828
|
function errMsg(src, dest, funcName) {
|
|
@@ -2847,7 +2847,7 @@ var require_copy = __commonJS({
|
|
|
2847
2847
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
|
|
2848
2848
|
"use strict";
|
|
2849
2849
|
var fs5 = require_fs();
|
|
2850
|
-
var
|
|
2850
|
+
var path6 = require("path");
|
|
2851
2851
|
var { mkdirs } = require_mkdirs();
|
|
2852
2852
|
var { pathExists: pathExists2 } = require_path_exists2();
|
|
2853
2853
|
var { utimesMillis } = require_utimes();
|
|
@@ -2870,7 +2870,7 @@ var require_copy = __commonJS({
|
|
|
2870
2870
|
const include = await runFilter(src, dest, opts);
|
|
2871
2871
|
if (!include)
|
|
2872
2872
|
return;
|
|
2873
|
-
const destParent =
|
|
2873
|
+
const destParent = path6.dirname(dest);
|
|
2874
2874
|
const dirExists = await pathExists2(destParent);
|
|
2875
2875
|
if (!dirExists) {
|
|
2876
2876
|
await mkdirs(destParent);
|
|
@@ -2931,8 +2931,8 @@ var require_copy = __commonJS({
|
|
|
2931
2931
|
}
|
|
2932
2932
|
const items = await fs5.readdir(src);
|
|
2933
2933
|
await Promise.all(items.map(async (item) => {
|
|
2934
|
-
const srcItem =
|
|
2935
|
-
const destItem =
|
|
2934
|
+
const srcItem = path6.join(src, item);
|
|
2935
|
+
const destItem = path6.join(dest, item);
|
|
2936
2936
|
const include = await runFilter(srcItem, destItem, opts);
|
|
2937
2937
|
if (!include)
|
|
2938
2938
|
return;
|
|
@@ -2946,7 +2946,7 @@ var require_copy = __commonJS({
|
|
|
2946
2946
|
async function onLink(destStat, src, dest, opts) {
|
|
2947
2947
|
let resolvedSrc = await fs5.readlink(src);
|
|
2948
2948
|
if (opts.dereference) {
|
|
2949
|
-
resolvedSrc =
|
|
2949
|
+
resolvedSrc = path6.resolve(process.cwd(), resolvedSrc);
|
|
2950
2950
|
}
|
|
2951
2951
|
if (!destStat) {
|
|
2952
2952
|
return fs5.symlink(resolvedSrc, dest);
|
|
@@ -2960,7 +2960,7 @@ var require_copy = __commonJS({
|
|
|
2960
2960
|
throw e;
|
|
2961
2961
|
}
|
|
2962
2962
|
if (opts.dereference) {
|
|
2963
|
-
resolvedDest =
|
|
2963
|
+
resolvedDest = path6.resolve(process.cwd(), resolvedDest);
|
|
2964
2964
|
}
|
|
2965
2965
|
if (stat2.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
2966
2966
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -2980,7 +2980,7 @@ var require_copy_sync = __commonJS({
|
|
|
2980
2980
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
|
|
2981
2981
|
"use strict";
|
|
2982
2982
|
var fs5 = require_graceful_fs();
|
|
2983
|
-
var
|
|
2983
|
+
var path6 = require("path");
|
|
2984
2984
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
2985
2985
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
2986
2986
|
var stat2 = require_stat();
|
|
@@ -3002,7 +3002,7 @@ var require_copy_sync = __commonJS({
|
|
|
3002
3002
|
stat2.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
3003
3003
|
if (opts.filter && !opts.filter(src, dest))
|
|
3004
3004
|
return;
|
|
3005
|
-
const destParent =
|
|
3005
|
+
const destParent = path6.dirname(dest);
|
|
3006
3006
|
if (!fs5.existsSync(destParent))
|
|
3007
3007
|
mkdirsSync(destParent);
|
|
3008
3008
|
return getStats(destStat, src, dest, opts);
|
|
@@ -3073,8 +3073,8 @@ var require_copy_sync = __commonJS({
|
|
|
3073
3073
|
fs5.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
3074
3074
|
}
|
|
3075
3075
|
function copyDirItem(item, src, dest, opts) {
|
|
3076
|
-
const srcItem =
|
|
3077
|
-
const destItem =
|
|
3076
|
+
const srcItem = path6.join(src, item);
|
|
3077
|
+
const destItem = path6.join(dest, item);
|
|
3078
3078
|
if (opts.filter && !opts.filter(srcItem, destItem))
|
|
3079
3079
|
return;
|
|
3080
3080
|
const { destStat } = stat2.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
@@ -3083,7 +3083,7 @@ var require_copy_sync = __commonJS({
|
|
|
3083
3083
|
function onLink(destStat, src, dest, opts) {
|
|
3084
3084
|
let resolvedSrc = fs5.readlinkSync(src);
|
|
3085
3085
|
if (opts.dereference) {
|
|
3086
|
-
resolvedSrc =
|
|
3086
|
+
resolvedSrc = path6.resolve(process.cwd(), resolvedSrc);
|
|
3087
3087
|
}
|
|
3088
3088
|
if (!destStat) {
|
|
3089
3089
|
return fs5.symlinkSync(resolvedSrc, dest);
|
|
@@ -3097,7 +3097,7 @@ var require_copy_sync = __commonJS({
|
|
|
3097
3097
|
throw err;
|
|
3098
3098
|
}
|
|
3099
3099
|
if (opts.dereference) {
|
|
3100
|
-
resolvedDest =
|
|
3100
|
+
resolvedDest = path6.resolve(process.cwd(), resolvedDest);
|
|
3101
3101
|
}
|
|
3102
3102
|
if (stat2.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
3103
3103
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -3134,11 +3134,11 @@ var require_remove = __commonJS({
|
|
|
3134
3134
|
"use strict";
|
|
3135
3135
|
var fs5 = require_graceful_fs();
|
|
3136
3136
|
var u = require_universalify().fromCallback;
|
|
3137
|
-
function remove2(
|
|
3138
|
-
fs5.rm(
|
|
3137
|
+
function remove2(path6, callback) {
|
|
3138
|
+
fs5.rm(path6, { recursive: true, force: true }, callback);
|
|
3139
3139
|
}
|
|
3140
|
-
function removeSync(
|
|
3141
|
-
fs5.rmSync(
|
|
3140
|
+
function removeSync(path6) {
|
|
3141
|
+
fs5.rmSync(path6, { recursive: true, force: true });
|
|
3142
3142
|
}
|
|
3143
3143
|
module2.exports = {
|
|
3144
3144
|
remove: u(remove2),
|
|
@@ -3153,7 +3153,7 @@ var require_empty = __commonJS({
|
|
|
3153
3153
|
"use strict";
|
|
3154
3154
|
var u = require_universalify().fromPromise;
|
|
3155
3155
|
var fs5 = require_fs();
|
|
3156
|
-
var
|
|
3156
|
+
var path6 = require("path");
|
|
3157
3157
|
var mkdir = require_mkdirs();
|
|
3158
3158
|
var remove2 = require_remove();
|
|
3159
3159
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
@@ -3163,7 +3163,7 @@ var require_empty = __commonJS({
|
|
|
3163
3163
|
} catch {
|
|
3164
3164
|
return mkdir.mkdirs(dir);
|
|
3165
3165
|
}
|
|
3166
|
-
return Promise.all(items.map((item) => remove2.remove(
|
|
3166
|
+
return Promise.all(items.map((item) => remove2.remove(path6.join(dir, item))));
|
|
3167
3167
|
});
|
|
3168
3168
|
function emptyDirSync(dir) {
|
|
3169
3169
|
let items;
|
|
@@ -3173,7 +3173,7 @@ var require_empty = __commonJS({
|
|
|
3173
3173
|
return mkdir.mkdirsSync(dir);
|
|
3174
3174
|
}
|
|
3175
3175
|
items.forEach((item) => {
|
|
3176
|
-
item =
|
|
3176
|
+
item = path6.join(dir, item);
|
|
3177
3177
|
remove2.removeSync(item);
|
|
3178
3178
|
});
|
|
3179
3179
|
}
|
|
@@ -3191,7 +3191,7 @@ var require_file = __commonJS({
|
|
|
3191
3191
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
|
|
3192
3192
|
"use strict";
|
|
3193
3193
|
var u = require_universalify().fromPromise;
|
|
3194
|
-
var
|
|
3194
|
+
var path6 = require("path");
|
|
3195
3195
|
var fs5 = require_fs();
|
|
3196
3196
|
var mkdir = require_mkdirs();
|
|
3197
3197
|
async function createFile(file) {
|
|
@@ -3202,7 +3202,7 @@ var require_file = __commonJS({
|
|
|
3202
3202
|
}
|
|
3203
3203
|
if (stats && stats.isFile())
|
|
3204
3204
|
return;
|
|
3205
|
-
const dir =
|
|
3205
|
+
const dir = path6.dirname(file);
|
|
3206
3206
|
let dirStats = null;
|
|
3207
3207
|
try {
|
|
3208
3208
|
dirStats = await fs5.stat(dir);
|
|
@@ -3229,7 +3229,7 @@ var require_file = __commonJS({
|
|
|
3229
3229
|
}
|
|
3230
3230
|
if (stats && stats.isFile())
|
|
3231
3231
|
return;
|
|
3232
|
-
const dir =
|
|
3232
|
+
const dir = path6.dirname(file);
|
|
3233
3233
|
try {
|
|
3234
3234
|
if (!fs5.statSync(dir).isDirectory()) {
|
|
3235
3235
|
fs5.readdirSync(dir);
|
|
@@ -3254,7 +3254,7 @@ var require_link = __commonJS({
|
|
|
3254
3254
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
|
|
3255
3255
|
"use strict";
|
|
3256
3256
|
var u = require_universalify().fromPromise;
|
|
3257
|
-
var
|
|
3257
|
+
var path6 = require("path");
|
|
3258
3258
|
var fs5 = require_fs();
|
|
3259
3259
|
var mkdir = require_mkdirs();
|
|
3260
3260
|
var { pathExists: pathExists2 } = require_path_exists2();
|
|
@@ -3274,7 +3274,7 @@ var require_link = __commonJS({
|
|
|
3274
3274
|
}
|
|
3275
3275
|
if (dstStat && areIdentical(srcStat, dstStat))
|
|
3276
3276
|
return;
|
|
3277
|
-
const dir =
|
|
3277
|
+
const dir = path6.dirname(dstpath);
|
|
3278
3278
|
const dirExists = await pathExists2(dir);
|
|
3279
3279
|
if (!dirExists) {
|
|
3280
3280
|
await mkdir.mkdirs(dir);
|
|
@@ -3295,7 +3295,7 @@ var require_link = __commonJS({
|
|
|
3295
3295
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
3296
3296
|
throw err;
|
|
3297
3297
|
}
|
|
3298
|
-
const dir =
|
|
3298
|
+
const dir = path6.dirname(dstpath);
|
|
3299
3299
|
const dirExists = fs5.existsSync(dir);
|
|
3300
3300
|
if (dirExists)
|
|
3301
3301
|
return fs5.linkSync(srcpath, dstpath);
|
|
@@ -3313,12 +3313,12 @@ var require_link = __commonJS({
|
|
|
3313
3313
|
var require_symlink_paths = __commonJS({
|
|
3314
3314
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
|
|
3315
3315
|
"use strict";
|
|
3316
|
-
var
|
|
3316
|
+
var path6 = require("path");
|
|
3317
3317
|
var fs5 = require_fs();
|
|
3318
3318
|
var { pathExists: pathExists2 } = require_path_exists2();
|
|
3319
3319
|
var u = require_universalify().fromPromise;
|
|
3320
3320
|
async function symlinkPaths(srcpath, dstpath) {
|
|
3321
|
-
if (
|
|
3321
|
+
if (path6.isAbsolute(srcpath)) {
|
|
3322
3322
|
try {
|
|
3323
3323
|
await fs5.lstat(srcpath);
|
|
3324
3324
|
} catch (err) {
|
|
@@ -3330,8 +3330,8 @@ var require_symlink_paths = __commonJS({
|
|
|
3330
3330
|
toDst: srcpath
|
|
3331
3331
|
};
|
|
3332
3332
|
}
|
|
3333
|
-
const dstdir =
|
|
3334
|
-
const relativeToDst =
|
|
3333
|
+
const dstdir = path6.dirname(dstpath);
|
|
3334
|
+
const relativeToDst = path6.join(dstdir, srcpath);
|
|
3335
3335
|
const exists = await pathExists2(relativeToDst);
|
|
3336
3336
|
if (exists) {
|
|
3337
3337
|
return {
|
|
@@ -3347,11 +3347,11 @@ var require_symlink_paths = __commonJS({
|
|
|
3347
3347
|
}
|
|
3348
3348
|
return {
|
|
3349
3349
|
toCwd: srcpath,
|
|
3350
|
-
toDst:
|
|
3350
|
+
toDst: path6.relative(dstdir, srcpath)
|
|
3351
3351
|
};
|
|
3352
3352
|
}
|
|
3353
3353
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
3354
|
-
if (
|
|
3354
|
+
if (path6.isAbsolute(srcpath)) {
|
|
3355
3355
|
const exists2 = fs5.existsSync(srcpath);
|
|
3356
3356
|
if (!exists2)
|
|
3357
3357
|
throw new Error("absolute srcpath does not exist");
|
|
@@ -3360,8 +3360,8 @@ var require_symlink_paths = __commonJS({
|
|
|
3360
3360
|
toDst: srcpath
|
|
3361
3361
|
};
|
|
3362
3362
|
}
|
|
3363
|
-
const dstdir =
|
|
3364
|
-
const relativeToDst =
|
|
3363
|
+
const dstdir = path6.dirname(dstpath);
|
|
3364
|
+
const relativeToDst = path6.join(dstdir, srcpath);
|
|
3365
3365
|
const exists = fs5.existsSync(relativeToDst);
|
|
3366
3366
|
if (exists) {
|
|
3367
3367
|
return {
|
|
@@ -3374,7 +3374,7 @@ var require_symlink_paths = __commonJS({
|
|
|
3374
3374
|
throw new Error("relative srcpath does not exist");
|
|
3375
3375
|
return {
|
|
3376
3376
|
toCwd: srcpath,
|
|
3377
|
-
toDst:
|
|
3377
|
+
toDst: path6.relative(dstdir, srcpath)
|
|
3378
3378
|
};
|
|
3379
3379
|
}
|
|
3380
3380
|
module2.exports = {
|
|
@@ -3424,7 +3424,7 @@ var require_symlink = __commonJS({
|
|
|
3424
3424
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
|
|
3425
3425
|
"use strict";
|
|
3426
3426
|
var u = require_universalify().fromPromise;
|
|
3427
|
-
var
|
|
3427
|
+
var path6 = require("path");
|
|
3428
3428
|
var fs5 = require_fs();
|
|
3429
3429
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
3430
3430
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
@@ -3448,7 +3448,7 @@ var require_symlink = __commonJS({
|
|
|
3448
3448
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
3449
3449
|
srcpath = relative.toDst;
|
|
3450
3450
|
const toType = await symlinkType(relative.toCwd, type);
|
|
3451
|
-
const dir =
|
|
3451
|
+
const dir = path6.dirname(dstpath);
|
|
3452
3452
|
if (!await pathExists2(dir)) {
|
|
3453
3453
|
await mkdirs(dir);
|
|
3454
3454
|
}
|
|
@@ -3469,7 +3469,7 @@ var require_symlink = __commonJS({
|
|
|
3469
3469
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
3470
3470
|
srcpath = relative.toDst;
|
|
3471
3471
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
3472
|
-
const dir =
|
|
3472
|
+
const dir = path6.dirname(dstpath);
|
|
3473
3473
|
const exists = fs5.existsSync(dir);
|
|
3474
3474
|
if (exists)
|
|
3475
3475
|
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
@@ -3621,18 +3621,18 @@ var require_output_file = __commonJS({
|
|
|
3621
3621
|
"use strict";
|
|
3622
3622
|
var u = require_universalify().fromPromise;
|
|
3623
3623
|
var fs5 = require_fs();
|
|
3624
|
-
var
|
|
3624
|
+
var path6 = require("path");
|
|
3625
3625
|
var mkdir = require_mkdirs();
|
|
3626
3626
|
var pathExists2 = require_path_exists2().pathExists;
|
|
3627
3627
|
async function outputFile(file, data, encoding = "utf-8") {
|
|
3628
|
-
const dir =
|
|
3628
|
+
const dir = path6.dirname(file);
|
|
3629
3629
|
if (!await pathExists2(dir)) {
|
|
3630
3630
|
await mkdir.mkdirs(dir);
|
|
3631
3631
|
}
|
|
3632
3632
|
return fs5.writeFile(file, data, encoding);
|
|
3633
3633
|
}
|
|
3634
3634
|
function outputFileSync(file, ...args) {
|
|
3635
|
-
const dir =
|
|
3635
|
+
const dir = path6.dirname(file);
|
|
3636
3636
|
if (!fs5.existsSync(dir)) {
|
|
3637
3637
|
mkdir.mkdirsSync(dir);
|
|
3638
3638
|
}
|
|
@@ -3696,7 +3696,7 @@ var require_move = __commonJS({
|
|
|
3696
3696
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
|
|
3697
3697
|
"use strict";
|
|
3698
3698
|
var fs5 = require_fs();
|
|
3699
|
-
var
|
|
3699
|
+
var path6 = require("path");
|
|
3700
3700
|
var { copy } = require_copy2();
|
|
3701
3701
|
var { remove: remove2 } = require_remove();
|
|
3702
3702
|
var { mkdirp } = require_mkdirs();
|
|
@@ -3706,8 +3706,8 @@ var require_move = __commonJS({
|
|
|
3706
3706
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
3707
3707
|
const { srcStat, isChangingCase = false } = await stat2.checkPaths(src, dest, "move", opts);
|
|
3708
3708
|
await stat2.checkParentPaths(src, srcStat, dest, "move");
|
|
3709
|
-
const destParent =
|
|
3710
|
-
const parsedParentPath =
|
|
3709
|
+
const destParent = path6.dirname(dest);
|
|
3710
|
+
const parsedParentPath = path6.parse(destParent);
|
|
3711
3711
|
if (parsedParentPath.root !== destParent) {
|
|
3712
3712
|
await mkdirp(destParent);
|
|
3713
3713
|
}
|
|
@@ -3748,7 +3748,7 @@ var require_move_sync = __commonJS({
|
|
|
3748
3748
|
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
|
|
3749
3749
|
"use strict";
|
|
3750
3750
|
var fs5 = require_graceful_fs();
|
|
3751
|
-
var
|
|
3751
|
+
var path6 = require("path");
|
|
3752
3752
|
var copySync = require_copy2().copySync;
|
|
3753
3753
|
var removeSync = require_remove().removeSync;
|
|
3754
3754
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -3759,12 +3759,12 @@ var require_move_sync = __commonJS({
|
|
|
3759
3759
|
const { srcStat, isChangingCase = false } = stat2.checkPathsSync(src, dest, "move", opts);
|
|
3760
3760
|
stat2.checkParentPathsSync(src, srcStat, dest, "move");
|
|
3761
3761
|
if (!isParentRoot(dest))
|
|
3762
|
-
mkdirpSync(
|
|
3762
|
+
mkdirpSync(path6.dirname(dest));
|
|
3763
3763
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
3764
3764
|
}
|
|
3765
3765
|
function isParentRoot(dest) {
|
|
3766
|
-
const parent =
|
|
3767
|
-
const parsedPath =
|
|
3766
|
+
const parent = path6.dirname(dest);
|
|
3767
|
+
const parsedPath = path6.parse(parent);
|
|
3768
3768
|
return parsedPath.root === parent;
|
|
3769
3769
|
}
|
|
3770
3770
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -8229,27 +8229,27 @@ var require_util = __commonJS({
|
|
|
8229
8229
|
};
|
|
8230
8230
|
}
|
|
8231
8231
|
var normalize = lruMemoize(function normalize2(aPath) {
|
|
8232
|
-
let
|
|
8232
|
+
let path6 = aPath;
|
|
8233
8233
|
const url3 = urlParse(aPath);
|
|
8234
8234
|
if (url3) {
|
|
8235
8235
|
if (!url3.path) {
|
|
8236
8236
|
return aPath;
|
|
8237
8237
|
}
|
|
8238
|
-
|
|
8238
|
+
path6 = url3.path;
|
|
8239
8239
|
}
|
|
8240
|
-
const isAbsolute = exports.isAbsolute(
|
|
8240
|
+
const isAbsolute = exports.isAbsolute(path6);
|
|
8241
8241
|
const parts = [];
|
|
8242
8242
|
let start = 0;
|
|
8243
8243
|
let i = 0;
|
|
8244
8244
|
while (true) {
|
|
8245
8245
|
start = i;
|
|
8246
|
-
i =
|
|
8246
|
+
i = path6.indexOf("/", start);
|
|
8247
8247
|
if (i === -1) {
|
|
8248
|
-
parts.push(
|
|
8248
|
+
parts.push(path6.slice(start));
|
|
8249
8249
|
break;
|
|
8250
8250
|
} else {
|
|
8251
|
-
parts.push(
|
|
8252
|
-
while (i <
|
|
8251
|
+
parts.push(path6.slice(start, i));
|
|
8252
|
+
while (i < path6.length && path6[i] === "/") {
|
|
8253
8253
|
i++;
|
|
8254
8254
|
}
|
|
8255
8255
|
}
|
|
@@ -8271,15 +8271,15 @@ var require_util = __commonJS({
|
|
|
8271
8271
|
}
|
|
8272
8272
|
}
|
|
8273
8273
|
}
|
|
8274
|
-
|
|
8275
|
-
if (
|
|
8276
|
-
|
|
8274
|
+
path6 = parts.join("/");
|
|
8275
|
+
if (path6 === "") {
|
|
8276
|
+
path6 = isAbsolute ? "/" : ".";
|
|
8277
8277
|
}
|
|
8278
8278
|
if (url3) {
|
|
8279
|
-
url3.path =
|
|
8279
|
+
url3.path = path6;
|
|
8280
8280
|
return urlGenerate(url3);
|
|
8281
8281
|
}
|
|
8282
|
-
return
|
|
8282
|
+
return path6;
|
|
8283
8283
|
});
|
|
8284
8284
|
exports.normalize = normalize;
|
|
8285
8285
|
function join2(aRoot, aPath) {
|
|
@@ -9044,10 +9044,10 @@ var require_read_wasm = __commonJS({
|
|
|
9044
9044
|
module2.exports.initialize = (input) => mappingsWasm = input;
|
|
9045
9045
|
} else {
|
|
9046
9046
|
const fs5 = require("fs");
|
|
9047
|
-
const
|
|
9047
|
+
const path6 = require("path");
|
|
9048
9048
|
module2.exports = function readWasm() {
|
|
9049
9049
|
return new Promise((resolve, reject) => {
|
|
9050
|
-
const wasmPath =
|
|
9050
|
+
const wasmPath = path6.join(__dirname, "mappings.wasm");
|
|
9051
9051
|
fs5.readFile(wasmPath, null, (error, data) => {
|
|
9052
9052
|
if (error) {
|
|
9053
9053
|
reject(error);
|
|
@@ -10495,7 +10495,7 @@ var require_convert_source_map = __commonJS({
|
|
|
10495
10495
|
"../../node_modules/.pnpm/convert-source-map@1.8.0/node_modules/convert-source-map/index.js"(exports) {
|
|
10496
10496
|
"use strict";
|
|
10497
10497
|
var fs5 = require("fs");
|
|
10498
|
-
var
|
|
10498
|
+
var path6 = require("path");
|
|
10499
10499
|
var SafeBuffer = require_safe_buffer();
|
|
10500
10500
|
Object.defineProperty(exports, "commentRegex", {
|
|
10501
10501
|
get: function getCommentRegex() {
|
|
@@ -10516,7 +10516,7 @@ var require_convert_source_map = __commonJS({
|
|
|
10516
10516
|
function readFromFileMap(sm, dir) {
|
|
10517
10517
|
var r = exports.mapFileCommentRegex.exec(sm);
|
|
10518
10518
|
var filename = r[1] || r[2];
|
|
10519
|
-
var filepath =
|
|
10519
|
+
var filepath = path6.resolve(dir, filename);
|
|
10520
10520
|
try {
|
|
10521
10521
|
return fs5.readFileSync(filepath, "utf8");
|
|
10522
10522
|
} catch (e) {
|
|
@@ -10700,7 +10700,7 @@ var require_get_nextjs_edge_function = __commonJS({
|
|
|
10700
10700
|
var require_resolve_from = __commonJS({
|
|
10701
10701
|
"../../node_modules/.pnpm/resolve-from@5.0.0/node_modules/resolve-from/index.js"(exports, module2) {
|
|
10702
10702
|
"use strict";
|
|
10703
|
-
var
|
|
10703
|
+
var path6 = require("path");
|
|
10704
10704
|
var Module = require("module");
|
|
10705
10705
|
var fs5 = require("fs");
|
|
10706
10706
|
var resolveFrom2 = (fromDirectory, moduleId, silent) => {
|
|
@@ -10714,14 +10714,14 @@ var require_resolve_from = __commonJS({
|
|
|
10714
10714
|
fromDirectory = fs5.realpathSync(fromDirectory);
|
|
10715
10715
|
} catch (error) {
|
|
10716
10716
|
if (error.code === "ENOENT") {
|
|
10717
|
-
fromDirectory =
|
|
10717
|
+
fromDirectory = path6.resolve(fromDirectory);
|
|
10718
10718
|
} else if (silent) {
|
|
10719
10719
|
return;
|
|
10720
10720
|
} else {
|
|
10721
10721
|
throw error;
|
|
10722
10722
|
}
|
|
10723
10723
|
}
|
|
10724
|
-
const fromFile =
|
|
10724
|
+
const fromFile = path6.join(fromDirectory, "noop.js");
|
|
10725
10725
|
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
|
10726
10726
|
id: fromFile,
|
|
10727
10727
|
filename: fromFile,
|
|
@@ -10821,13 +10821,13 @@ var import_async_sema3 = __toESM(require_lib());
|
|
|
10821
10821
|
var import_escape_string_regexp3 = __toESM(require_escape_string_regexp());
|
|
10822
10822
|
var import_find_up = __toESM(require_find_up());
|
|
10823
10823
|
var import_fs_extra6 = __toESM(require_lib2());
|
|
10824
|
-
var
|
|
10824
|
+
var import_path6 = __toESM(require("path"));
|
|
10825
10825
|
var import_semver4 = __toESM(require_semver());
|
|
10826
10826
|
var import_url2 = __toESM(require("url"));
|
|
10827
10827
|
|
|
10828
10828
|
// src/create-serverless-config.ts
|
|
10829
10829
|
var import_fs_extra4 = __toESM(require_lib2());
|
|
10830
|
-
var
|
|
10830
|
+
var import_path4 = __toESM(require("path"));
|
|
10831
10831
|
var import_semver2 = __toESM(require_semver());
|
|
10832
10832
|
|
|
10833
10833
|
// src/utils.ts
|
|
@@ -10835,7 +10835,7 @@ var import_build_utils = require("@vercel/build-utils");
|
|
|
10835
10835
|
var import_async_sema = __toESM(require_lib());
|
|
10836
10836
|
var import_buffer_crc32 = __toESM(require_buffer_crc32());
|
|
10837
10837
|
var import_fs_extra3 = __toESM(require_lib2());
|
|
10838
|
-
var
|
|
10838
|
+
var import_path3 = __toESM(require("path"));
|
|
10839
10839
|
var import_semver = __toESM(require_semver());
|
|
10840
10840
|
var import_url = __toESM(require("url"));
|
|
10841
10841
|
var import_module = require("module");
|
|
@@ -10988,6 +10988,129 @@ async function validateSize(script, wasmFiles) {
|
|
|
10988
10988
|
}
|
|
10989
10989
|
}
|
|
10990
10990
|
|
|
10991
|
+
// src/metadata.ts
|
|
10992
|
+
var import_path2 = __toESM(require("path"));
|
|
10993
|
+
var STATIC_METADATA_IMAGES = {
|
|
10994
|
+
icon: {
|
|
10995
|
+
filename: "icon",
|
|
10996
|
+
extensions: ["ico", "jpg", "jpeg", "png", "svg"]
|
|
10997
|
+
},
|
|
10998
|
+
apple: {
|
|
10999
|
+
filename: "apple-icon",
|
|
11000
|
+
extensions: ["jpg", "jpeg", "png"]
|
|
11001
|
+
},
|
|
11002
|
+
openGraph: {
|
|
11003
|
+
filename: "opengraph-image",
|
|
11004
|
+
extensions: ["jpg", "jpeg", "png", "gif"]
|
|
11005
|
+
},
|
|
11006
|
+
twitter: {
|
|
11007
|
+
filename: "twitter-image",
|
|
11008
|
+
extensions: ["jpg", "jpeg", "png", "gif"]
|
|
11009
|
+
}
|
|
11010
|
+
};
|
|
11011
|
+
var groupSuffix = "(-\\w{6})?";
|
|
11012
|
+
var suffixMatcher = "\\d?";
|
|
11013
|
+
var METADATA_STATIC_FILE_REGEX = [
|
|
11014
|
+
new RegExp(`^[\\\\/]robots\\.txt$`),
|
|
11015
|
+
new RegExp(`^[\\\\/]manifest\\.(webmanifest|json)$`),
|
|
11016
|
+
new RegExp(`[\\\\/]sitemap\\.xml$`),
|
|
11017
|
+
new RegExp(`^[\\\\/]favicon\\.ico$`),
|
|
11018
|
+
new RegExp(
|
|
11019
|
+
`[\\\\/]${STATIC_METADATA_IMAGES.icon.filename}${suffixMatcher}${groupSuffix}${`\\.(?:${STATIC_METADATA_IMAGES.icon.extensions.join("|")})`}$`
|
|
11020
|
+
),
|
|
11021
|
+
new RegExp(
|
|
11022
|
+
`[\\\\/]${STATIC_METADATA_IMAGES.apple.filename}${suffixMatcher}${groupSuffix}${`\\.(?:${STATIC_METADATA_IMAGES.apple.extensions.join("|")})`}$`
|
|
11023
|
+
),
|
|
11024
|
+
new RegExp(
|
|
11025
|
+
`[\\\\/]${STATIC_METADATA_IMAGES.openGraph.filename}${suffixMatcher}${groupSuffix}${`\\.(?:${STATIC_METADATA_IMAGES.openGraph.extensions.join("|")})`}$`
|
|
11026
|
+
),
|
|
11027
|
+
new RegExp(
|
|
11028
|
+
`[\\\\/]${STATIC_METADATA_IMAGES.twitter.filename}${suffixMatcher}${groupSuffix}${`\\.(?:${STATIC_METADATA_IMAGES.twitter.extensions.join("|")})`}$`
|
|
11029
|
+
)
|
|
11030
|
+
];
|
|
11031
|
+
function isStaticMetadataRoute(pathname) {
|
|
11032
|
+
return METADATA_STATIC_FILE_REGEX.some((regex) => regex.test(pathname));
|
|
11033
|
+
}
|
|
11034
|
+
var CONTENT_TYPE_MAP = {
|
|
11035
|
+
ico: "image/x-icon",
|
|
11036
|
+
png: "image/png",
|
|
11037
|
+
jpg: "image/jpeg",
|
|
11038
|
+
jpeg: "image/jpeg",
|
|
11039
|
+
gif: "image/gif",
|
|
11040
|
+
svg: "image/svg+xml",
|
|
11041
|
+
txt: "text/plain",
|
|
11042
|
+
xml: "application/xml",
|
|
11043
|
+
json: "application/manifest+json",
|
|
11044
|
+
webmanifest: "application/manifest+json"
|
|
11045
|
+
};
|
|
11046
|
+
function djb2Hash(str) {
|
|
11047
|
+
let hash = 5381;
|
|
11048
|
+
for (let i = 0; i < str.length; i++) {
|
|
11049
|
+
const char = str.charCodeAt(i);
|
|
11050
|
+
hash = (hash << 5) + hash + char & 4294967295;
|
|
11051
|
+
}
|
|
11052
|
+
return hash >>> 0;
|
|
11053
|
+
}
|
|
11054
|
+
function getMetadataRouteSuffix(page) {
|
|
11055
|
+
const parentPathname = import_path2.default.dirname(page);
|
|
11056
|
+
if (page.endsWith("/sitemap")) {
|
|
11057
|
+
return "";
|
|
11058
|
+
}
|
|
11059
|
+
let suffix = "";
|
|
11060
|
+
const segments = parentPathname.split("/");
|
|
11061
|
+
if (segments.some(
|
|
11062
|
+
(seg) => seg.startsWith("(") && seg.endsWith(")") || seg.startsWith("@") && seg !== "@children"
|
|
11063
|
+
)) {
|
|
11064
|
+
suffix = djb2Hash(parentPathname).toString(36).slice(0, 6);
|
|
11065
|
+
}
|
|
11066
|
+
return suffix;
|
|
11067
|
+
}
|
|
11068
|
+
function normalizeAppPath(route) {
|
|
11069
|
+
const normalized = route.split("/").reduce((pathname2, segment) => {
|
|
11070
|
+
if (!segment) {
|
|
11071
|
+
return pathname2;
|
|
11072
|
+
}
|
|
11073
|
+
if (segment.startsWith("(") && segment.endsWith(")")) {
|
|
11074
|
+
return pathname2;
|
|
11075
|
+
}
|
|
11076
|
+
if (segment[0] === "@") {
|
|
11077
|
+
return pathname2;
|
|
11078
|
+
}
|
|
11079
|
+
return `${pathname2}/${segment}`;
|
|
11080
|
+
}, "");
|
|
11081
|
+
const { dir, name, ext } = import_path2.default.parse(normalized);
|
|
11082
|
+
const suffix = getMetadataRouteSuffix(route);
|
|
11083
|
+
const pathname = import_path2.default.posix.join(
|
|
11084
|
+
dir,
|
|
11085
|
+
`${name}${suffix ? `-${suffix}` : ""}${ext}`
|
|
11086
|
+
);
|
|
11087
|
+
return pathname;
|
|
11088
|
+
}
|
|
11089
|
+
function getContentTypeFromFile(fileRef) {
|
|
11090
|
+
const ext = import_path2.default.extname(fileRef.fsPath).slice(1);
|
|
11091
|
+
return CONTENT_TYPE_MAP[ext];
|
|
11092
|
+
}
|
|
11093
|
+
function getSourceFileRefOfStaticMetadata(routeKey, appPathnameFilesMap) {
|
|
11094
|
+
const isMetadataPattern = isStaticMetadataRoute(routeKey);
|
|
11095
|
+
if (isMetadataPattern) {
|
|
11096
|
+
const hasStaticSourceFile = appPathnameFilesMap.has(routeKey);
|
|
11097
|
+
if (hasStaticSourceFile) {
|
|
11098
|
+
return appPathnameFilesMap.get(routeKey);
|
|
11099
|
+
}
|
|
11100
|
+
}
|
|
11101
|
+
return void 0;
|
|
11102
|
+
}
|
|
11103
|
+
function getAppRouterPathnameFilesMap(files) {
|
|
11104
|
+
const appPathnameFilesMap = /* @__PURE__ */ new Map();
|
|
11105
|
+
for (const [filePath, fileRef] of Object.entries(files)) {
|
|
11106
|
+
if (filePath.startsWith("app/") && "fsPath" in fileRef) {
|
|
11107
|
+
const normalizedPath = normalizeAppPath(filePath.slice(3));
|
|
11108
|
+
appPathnameFilesMap.set(normalizedPath, fileRef);
|
|
11109
|
+
}
|
|
11110
|
+
}
|
|
11111
|
+
return appPathnameFilesMap;
|
|
11112
|
+
}
|
|
11113
|
+
|
|
10991
11114
|
// src/utils.ts
|
|
10992
11115
|
var require_ = (0, import_module.createRequire)(__filename);
|
|
10993
11116
|
var RSC_CONTENT_TYPE = "x-component";
|
|
@@ -11060,11 +11183,11 @@ function normalizePackageJson(defaultPackageJson = {}) {
|
|
|
11060
11183
|
};
|
|
11061
11184
|
}
|
|
11062
11185
|
async function getNextConfig(workPath, entryPath) {
|
|
11063
|
-
const entryConfig =
|
|
11186
|
+
const entryConfig = import_path3.default.join(entryPath, "./next.config.js");
|
|
11064
11187
|
if (await import_fs_extra3.default.pathExists(entryConfig)) {
|
|
11065
11188
|
return import_fs_extra3.default.readFile(entryConfig, "utf8");
|
|
11066
11189
|
}
|
|
11067
|
-
const workConfig =
|
|
11190
|
+
const workConfig = import_path3.default.join(workPath, "./next.config.js");
|
|
11068
11191
|
if (await import_fs_extra3.default.pathExists(workConfig)) {
|
|
11069
11192
|
return import_fs_extra3.default.readFile(workConfig, "utf8");
|
|
11070
11193
|
}
|
|
@@ -11097,7 +11220,7 @@ async function getRoutesManifest(entryPath, outputDirectory, nextVersion) {
|
|
|
11097
11220
|
const shouldHaveManifest = nextVersion && import_semver.default.gte(nextVersion, "9.1.4-canary.0");
|
|
11098
11221
|
if (!shouldHaveManifest)
|
|
11099
11222
|
return;
|
|
11100
|
-
const pathRoutesManifest =
|
|
11223
|
+
const pathRoutesManifest = import_path3.default.join(
|
|
11101
11224
|
entryPath,
|
|
11102
11225
|
outputDirectory,
|
|
11103
11226
|
"routes-manifest.json"
|
|
@@ -11126,7 +11249,7 @@ async function getRoutesManifest(entryPath, outputDirectory, nextVersion) {
|
|
|
11126
11249
|
return routesManifest;
|
|
11127
11250
|
}
|
|
11128
11251
|
function getDestinationForSegmentRoute(isDev, entryDirectory, routeKeys, prefetchSegmentDataRoute) {
|
|
11129
|
-
return `${!isDev ?
|
|
11252
|
+
return `${!isDev ? import_path3.default.posix.join(
|
|
11130
11253
|
"/",
|
|
11131
11254
|
entryDirectory,
|
|
11132
11255
|
prefetchSegmentDataRoute.destination
|
|
@@ -11155,7 +11278,7 @@ async function getDynamicRoutes({
|
|
|
11155
11278
|
return routesManifest.dynamicRoutes.filter(({ page }) => canUsePreviewMode || !omittedRoutes?.has(page)).map(({ page, regex }) => {
|
|
11156
11279
|
return {
|
|
11157
11280
|
src: regex,
|
|
11158
|
-
dest: !isDev ?
|
|
11281
|
+
dest: !isDev ? import_path3.default.posix.join("/", entryDirectory, page) : page,
|
|
11159
11282
|
check: true,
|
|
11160
11283
|
status: canUsePreviewMode && omittedRoutes?.has(page) ? 404 : void 0
|
|
11161
11284
|
};
|
|
@@ -11197,7 +11320,7 @@ async function getDynamicRoutes({
|
|
|
11197
11320
|
} = params;
|
|
11198
11321
|
const route = {
|
|
11199
11322
|
src: namedRegex || regex,
|
|
11200
|
-
dest: `${!isDev ?
|
|
11323
|
+
dest: `${!isDev ? import_path3.default.posix.join("/", entryDirectory, page) : page}${routeKeys ? `?${Object.keys(routeKeys).map((key) => `${routeKeys[key]}=$${key}`).join("&")}` : ""}`
|
|
11201
11324
|
};
|
|
11202
11325
|
const { renderingMode, prefetchDataRoute } = prerenderManifest.fallbackRoutes[page] ?? prerenderManifest.blockingFallbackRoutes[page] ?? prerenderManifest.omittedRoutes[page] ?? {};
|
|
11203
11326
|
const isRoutePPREnabled = renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */;
|
|
@@ -11312,7 +11435,7 @@ async function getDynamicRoutes({
|
|
|
11312
11435
|
}));
|
|
11313
11436
|
const routes = [];
|
|
11314
11437
|
pageMatchers.forEach((pageMatcher) => {
|
|
11315
|
-
const dest = !isDev ?
|
|
11438
|
+
const dest = !isDev ? import_path3.default.posix.join("/", entryDirectory, pageMatcher.pageName) : pageMatcher.pageName;
|
|
11316
11439
|
if (pageMatcher && pageMatcher.matcher) {
|
|
11317
11440
|
routes.push({
|
|
11318
11441
|
src: pageMatcher.matcher.source,
|
|
@@ -11357,8 +11480,8 @@ function localizeDynamicRoutes(dynamicRoutes, dynamicPrefix, entryDirectory, sta
|
|
|
11357
11480
|
);
|
|
11358
11481
|
if (isLocalePrefixed && !(isCorrectLocaleAPIRoutes && isApiRoute) && !isAppRoute) {
|
|
11359
11482
|
route.dest = route.dest.replace(
|
|
11360
|
-
`${
|
|
11361
|
-
`${
|
|
11483
|
+
`${import_path3.default.posix.join("/", entryDirectory, "/")}`,
|
|
11484
|
+
`${import_path3.default.posix.join("/", entryDirectory, "$nextLocale", "/")}`
|
|
11362
11485
|
);
|
|
11363
11486
|
}
|
|
11364
11487
|
} else {
|
|
@@ -11372,7 +11495,7 @@ function localizeDynamicRoutes(dynamicRoutes, dynamicPrefix, entryDirectory, sta
|
|
|
11372
11495
|
return finalDynamicRoutes;
|
|
11373
11496
|
}
|
|
11374
11497
|
async function getImagesManifest(entryPath, outputDirectory) {
|
|
11375
|
-
const pathImagesManifest =
|
|
11498
|
+
const pathImagesManifest = import_path3.default.join(
|
|
11376
11499
|
entryPath,
|
|
11377
11500
|
outputDirectory,
|
|
11378
11501
|
"images-manifest.json"
|
|
@@ -11394,7 +11517,7 @@ function filterStaticPages(staticPageFiles, dynamicPages, entryDirectory, htmlCo
|
|
|
11394
11517
|
if (prerenderManifest.staticRoutes[routeName] || prerenderManifest.fallbackRoutes[routeName] || prerenderManifest.staticRoutes[normalizePage(pathname)] || prerenderManifest.fallbackRoutes[normalizePage(pathname)]) {
|
|
11395
11518
|
return;
|
|
11396
11519
|
}
|
|
11397
|
-
const staticRoute =
|
|
11520
|
+
const staticRoute = import_path3.default.posix.join(entryDirectory, pathname);
|
|
11398
11521
|
staticPages[staticRoute] = staticPageFiles[page];
|
|
11399
11522
|
staticPages[staticRoute].contentType = htmlContentType2;
|
|
11400
11523
|
if (isDynamicRoute(pathname)) {
|
|
@@ -11440,7 +11563,7 @@ var collectTracedFiles = (baseDir, lstatResults, lstatSema, reasons) => async (f
|
|
|
11440
11563
|
if (reason && reason.type.includes("initial")) {
|
|
11441
11564
|
return;
|
|
11442
11565
|
}
|
|
11443
|
-
const filePath =
|
|
11566
|
+
const filePath = import_path3.default.join(baseDir, file);
|
|
11444
11567
|
if (!lstatResults[filePath]) {
|
|
11445
11568
|
lstatResults[filePath] = lstatSema.acquire().then(() => (0, import_fs_extra3.lstat)(filePath)).finally(() => lstatSema.release());
|
|
11446
11569
|
}
|
|
@@ -11448,7 +11571,7 @@ var collectTracedFiles = (baseDir, lstatResults, lstatSema, reasons) => async (f
|
|
|
11448
11571
|
return [
|
|
11449
11572
|
file,
|
|
11450
11573
|
new import_build_utils.FileFsRef({
|
|
11451
|
-
fsPath:
|
|
11574
|
+
fsPath: import_path3.default.join(baseDir, file),
|
|
11452
11575
|
mode
|
|
11453
11576
|
})
|
|
11454
11577
|
];
|
|
@@ -11527,7 +11650,7 @@ async function createLambdaFromPseudoLayers({
|
|
|
11527
11650
|
});
|
|
11528
11651
|
}
|
|
11529
11652
|
async function getExportIntent(entryPath) {
|
|
11530
|
-
const pathExportMarker =
|
|
11653
|
+
const pathExportMarker = import_path3.default.join(entryPath, ".next", "export-marker.json");
|
|
11531
11654
|
const hasExportMarker = await import_fs_extra3.default.access(pathExportMarker, import_fs_extra3.default.constants.F_OK).then(() => true).catch(() => false);
|
|
11532
11655
|
if (!hasExportMarker) {
|
|
11533
11656
|
return false;
|
|
@@ -11546,7 +11669,7 @@ async function getExportIntent(entryPath) {
|
|
|
11546
11669
|
}
|
|
11547
11670
|
}
|
|
11548
11671
|
async function getExportStatus(entryPath) {
|
|
11549
|
-
const pathExportDetail =
|
|
11672
|
+
const pathExportDetail = import_path3.default.join(entryPath, ".next", "export-detail.json");
|
|
11550
11673
|
const hasExportDetail = await import_fs_extra3.default.access(pathExportDetail, import_fs_extra3.default.constants.F_OK).then(() => true).catch(() => false);
|
|
11551
11674
|
if (!hasExportDetail) {
|
|
11552
11675
|
return false;
|
|
@@ -11565,7 +11688,7 @@ async function getExportStatus(entryPath) {
|
|
|
11565
11688
|
}
|
|
11566
11689
|
}
|
|
11567
11690
|
async function getRequiredServerFilesManifest(entryPath, outputDirectory) {
|
|
11568
|
-
const pathRequiredServerFilesManifest =
|
|
11691
|
+
const pathRequiredServerFilesManifest = import_path3.default.join(
|
|
11569
11692
|
entryPath,
|
|
11570
11693
|
outputDirectory,
|
|
11571
11694
|
"required-server-files.json"
|
|
@@ -11601,7 +11724,7 @@ async function getRequiredServerFilesManifest(entryPath, outputDirectory) {
|
|
|
11601
11724
|
return requiredServerFiles;
|
|
11602
11725
|
}
|
|
11603
11726
|
async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
11604
|
-
const pathPrerenderManifest =
|
|
11727
|
+
const pathPrerenderManifest = import_path3.default.join(
|
|
11605
11728
|
entryPath,
|
|
11606
11729
|
outputDirectory,
|
|
11607
11730
|
"prerender-manifest.json"
|
|
@@ -11814,7 +11937,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
|
|
|
11814
11937
|
var _usesSrcCache;
|
|
11815
11938
|
async function usesSrcDirectory(workPath) {
|
|
11816
11939
|
if (!_usesSrcCache) {
|
|
11817
|
-
const sourcePages =
|
|
11940
|
+
const sourcePages = import_path3.default.join(workPath, "src", "pages");
|
|
11818
11941
|
try {
|
|
11819
11942
|
if ((await import_fs_extra3.default.stat(sourcePages)).isDirectory()) {
|
|
11820
11943
|
_usesSrcCache = true;
|
|
@@ -11824,7 +11947,7 @@ async function usesSrcDirectory(workPath) {
|
|
|
11824
11947
|
}
|
|
11825
11948
|
}
|
|
11826
11949
|
if (!_usesSrcCache) {
|
|
11827
|
-
const sourceAppdir =
|
|
11950
|
+
const sourceAppdir = import_path3.default.join(workPath, "src", "app");
|
|
11828
11951
|
try {
|
|
11829
11952
|
if ((await import_fs_extra3.default.stat(sourceAppdir)).isDirectory()) {
|
|
11830
11953
|
_usesSrcCache = true;
|
|
@@ -11846,40 +11969,40 @@ async function getSourceFilePathFromPage({
|
|
|
11846
11969
|
// middleware is not nested in pages/app
|
|
11847
11970
|
...page === "middleware" ? [""] : ["pages", "app"]
|
|
11848
11971
|
]) {
|
|
11849
|
-
let fsPath =
|
|
11972
|
+
let fsPath = import_path3.default.join(workPath, pageType, page);
|
|
11850
11973
|
if (usesSrcDir) {
|
|
11851
|
-
fsPath =
|
|
11974
|
+
fsPath = import_path3.default.join(workPath, "src", pageType, page);
|
|
11852
11975
|
}
|
|
11853
11976
|
if (import_fs_extra3.default.existsSync(fsPath)) {
|
|
11854
|
-
return
|
|
11977
|
+
return import_path3.default.relative(workPath, fsPath);
|
|
11855
11978
|
}
|
|
11856
|
-
const extensionless = fsPath.replace(
|
|
11979
|
+
const extensionless = fsPath.replace(import_path3.default.extname(fsPath), "");
|
|
11857
11980
|
for (const ext of extensionsToTry) {
|
|
11858
11981
|
fsPath = `${extensionless}.${ext}`;
|
|
11859
|
-
if (pageType === "app" && extensionless ===
|
|
11982
|
+
if (pageType === "app" && extensionless === import_path3.default.join(workPath, `${usesSrcDir ? "src/" : ""}app/index`)) {
|
|
11860
11983
|
fsPath = `${extensionless.replace(/index$/, "page")}.${ext}`;
|
|
11861
11984
|
}
|
|
11862
11985
|
if (import_fs_extra3.default.existsSync(fsPath)) {
|
|
11863
|
-
return
|
|
11986
|
+
return import_path3.default.relative(workPath, fsPath);
|
|
11864
11987
|
}
|
|
11865
11988
|
}
|
|
11866
11989
|
if (isDirectory(extensionless)) {
|
|
11867
11990
|
if (pageType === "pages") {
|
|
11868
11991
|
for (const ext of extensionsToTry) {
|
|
11869
|
-
fsPath =
|
|
11992
|
+
fsPath = import_path3.default.join(extensionless, `index.${ext}`);
|
|
11870
11993
|
if (import_fs_extra3.default.existsSync(fsPath)) {
|
|
11871
|
-
return
|
|
11994
|
+
return import_path3.default.relative(workPath, fsPath);
|
|
11872
11995
|
}
|
|
11873
11996
|
}
|
|
11874
11997
|
} else {
|
|
11875
11998
|
for (const ext of extensionsToTry) {
|
|
11876
|
-
fsPath =
|
|
11999
|
+
fsPath = import_path3.default.join(extensionless, `page.${ext}`);
|
|
11877
12000
|
if (import_fs_extra3.default.existsSync(fsPath)) {
|
|
11878
|
-
return
|
|
12001
|
+
return import_path3.default.relative(workPath, fsPath);
|
|
11879
12002
|
}
|
|
11880
|
-
fsPath =
|
|
12003
|
+
fsPath = import_path3.default.join(extensionless, `route.${ext}`);
|
|
11881
12004
|
if (import_fs_extra3.default.existsSync(fsPath)) {
|
|
11882
|
-
return
|
|
12005
|
+
return import_path3.default.relative(workPath, fsPath);
|
|
11883
12006
|
}
|
|
11884
12007
|
}
|
|
11885
12008
|
}
|
|
@@ -11900,8 +12023,8 @@ async function getSourceFilePathFromPage({
|
|
|
11900
12023
|
}
|
|
11901
12024
|
return "";
|
|
11902
12025
|
}
|
|
11903
|
-
function isDirectory(
|
|
11904
|
-
return import_fs_extra3.default.existsSync(
|
|
12026
|
+
function isDirectory(path6) {
|
|
12027
|
+
return import_fs_extra3.default.existsSync(path6) && import_fs_extra3.default.lstatSync(path6).isDirectory();
|
|
11905
12028
|
}
|
|
11906
12029
|
function normalizeLocalePath(pathname, locales) {
|
|
11907
12030
|
let detectedLocale;
|
|
@@ -11985,7 +12108,7 @@ async function getPageLambdaGroups({
|
|
|
11985
12108
|
});
|
|
11986
12109
|
const config2 = JSON.parse(
|
|
11987
12110
|
await import_fs_extra3.default.readFile(
|
|
11988
|
-
|
|
12111
|
+
import_path3.default.join(entryPath, import_path3.default.dirname(sourceFile), "../config.json"),
|
|
11989
12112
|
"utf8"
|
|
11990
12113
|
).catch(() => "{}")
|
|
11991
12114
|
);
|
|
@@ -11996,7 +12119,7 @@ async function getPageLambdaGroups({
|
|
|
11996
12119
|
}
|
|
11997
12120
|
}
|
|
11998
12121
|
let matchingGroup = experimentalAllowBundling ? void 0 : groups.find((group) => {
|
|
11999
|
-
const matches = group.maxDuration === opts.maxDuration && group.memory === opts.memory && group.isPrerenders === isPrerenderRoute && group.isExperimentalPPR === isExperimentalPPR && JSON.stringify(group.experimentalTriggers) === JSON.stringify(opts.experimentalTriggers);
|
|
12122
|
+
const matches = group.maxDuration === opts.maxDuration && group.memory === opts.memory && group.isPrerenders === isPrerenderRoute && group.isExperimentalPPR === isExperimentalPPR && JSON.stringify(group.experimentalTriggers) === JSON.stringify(opts.experimentalTriggers) && group.supportsCancellation === opts.supportsCancellation;
|
|
12000
12123
|
if (matches) {
|
|
12001
12124
|
let newTracedFilesUncompressedSize = group.pseudoLayerUncompressedBytes;
|
|
12002
12125
|
for (const newPage of newPages) {
|
|
@@ -12025,7 +12148,8 @@ async function getPageLambdaGroups({
|
|
|
12025
12148
|
pseudoLayerBytes: initialPseudoLayer.pseudoLayerBytes,
|
|
12026
12149
|
pseudoLayerUncompressedBytes: initialPseudoLayerUncompressed,
|
|
12027
12150
|
pseudoLayer: Object.assign({}, initialPseudoLayer.pseudoLayer),
|
|
12028
|
-
experimentalTriggers: opts.experimentalTriggers
|
|
12151
|
+
experimentalTriggers: opts.experimentalTriggers,
|
|
12152
|
+
supportsCancellation: opts.supportsCancellation
|
|
12029
12153
|
};
|
|
12030
12154
|
groups.push(newGroup);
|
|
12031
12155
|
matchingGroup = newGroup;
|
|
@@ -12179,10 +12303,10 @@ var onPrerenderRouteInitial = (prerenderManifest, canUsePreviewMode, entryDirect
|
|
|
12179
12303
|
const isAppPathRoute = appDir && (!dataRoute || dataRoute?.endsWith(".rsc"));
|
|
12180
12304
|
const routeNoLocale = routesManifest?.i18n ? normalizeLocalePath(routeKey, routesManifest.i18n.locales).pathname : routeKey;
|
|
12181
12305
|
if (routeNoLocale === "/404") {
|
|
12182
|
-
static404Page =
|
|
12306
|
+
static404Page = import_path3.default.posix.join(entryDirectory, routeKey);
|
|
12183
12307
|
}
|
|
12184
12308
|
if (routeNoLocale === "/500") {
|
|
12185
|
-
static500Page =
|
|
12309
|
+
static500Page = import_path3.default.posix.join(entryDirectory, routeKey);
|
|
12186
12310
|
}
|
|
12187
12311
|
if (
|
|
12188
12312
|
// App paths must be Prerenders to ensure Vary header is
|
|
@@ -12231,7 +12355,8 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12231
12355
|
isEmptyAllowQueryForPrendered,
|
|
12232
12356
|
isAppPPREnabled,
|
|
12233
12357
|
isAppClientSegmentCacheEnabled,
|
|
12234
|
-
isAppClientParamParsingEnabled
|
|
12358
|
+
isAppClientParamParsingEnabled,
|
|
12359
|
+
appPathnameFilesMap
|
|
12235
12360
|
} = prerenderRouteArgs;
|
|
12236
12361
|
if (isBlocking && isFallback) {
|
|
12237
12362
|
throw new import_build_utils.NowBuildError({
|
|
@@ -12350,7 +12475,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12350
12475
|
let didPostpone = false;
|
|
12351
12476
|
if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && appDir && !isBlocking) {
|
|
12352
12477
|
postponedState = getHTMLPostponedState({ appDir, routeFileNoExt });
|
|
12353
|
-
const htmlPath =
|
|
12478
|
+
const htmlPath = import_path3.default.join(appDir, `${routeFileNoExt}.html`);
|
|
12354
12479
|
if (import_fs_extra3.default.existsSync(htmlPath)) {
|
|
12355
12480
|
const html = import_fs_extra3.default.readFileSync(htmlPath, "utf8");
|
|
12356
12481
|
initialHeaders ??= {};
|
|
@@ -12376,7 +12501,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12376
12501
|
});
|
|
12377
12502
|
} else if (appDir && !dataRoute && !prefetchDataRoute && isAppPathRoute && !(isBlocking || isFallback)) {
|
|
12378
12503
|
const contentType = initialHeaders?.["content-type"];
|
|
12379
|
-
const fsPath =
|
|
12504
|
+
const fsPath = import_path3.default.join(appDir, `${routeFileNoExt}.body`);
|
|
12380
12505
|
if (import_fs_extra3.default.existsSync(fsPath)) {
|
|
12381
12506
|
htmlFallbackFsRef = new import_build_utils.FileFsRef({
|
|
12382
12507
|
fsPath,
|
|
@@ -12388,7 +12513,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12388
12513
|
// Blocking pages do not have an HTML fallback
|
|
12389
12514
|
null
|
|
12390
12515
|
) : new import_build_utils.FileFsRef({
|
|
12391
|
-
fsPath:
|
|
12516
|
+
fsPath: import_path3.default.join(
|
|
12392
12517
|
isAppPathRoute && !isOmittedOrNotFound && appDir ? appDir : pagesDir,
|
|
12393
12518
|
isFallback ? (
|
|
12394
12519
|
// Fallback pages have a special file.
|
|
@@ -12409,7 +12534,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12409
12534
|
if (!isFallback && !isBlocking && (!isNotFound || static404Page) && dataRoute && (!isAppClientParamParsingEnabled || prefetchDataRoute)) {
|
|
12410
12535
|
const basePath = isAppPathRoute && !isOmittedOrNotFound && appDir ? appDir : pagesDir;
|
|
12411
12536
|
dataFallbackFsRef = new import_build_utils.FileFsRef({
|
|
12412
|
-
fsPath:
|
|
12537
|
+
fsPath: import_path3.default.join(
|
|
12413
12538
|
basePath,
|
|
12414
12539
|
`${isOmittedOrNotFound ? localePrefixed404 ? addLocaleOrDefault("/404.html", routesManifest, locale) : "/404.html" : isAppPathRoute ? (
|
|
12415
12540
|
// When experimental PPR is enabled, we expect that the data
|
|
@@ -12425,17 +12550,17 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12425
12550
|
if (isOmittedOrNotFound) {
|
|
12426
12551
|
initialStatus = 404;
|
|
12427
12552
|
}
|
|
12428
|
-
let outputPathPage =
|
|
12553
|
+
let outputPathPage = import_path3.default.posix.join(entryDirectory, routeFileNoExt);
|
|
12429
12554
|
if (!isAppPathRoute) {
|
|
12430
12555
|
outputPathPage = normalizeIndexOutput(outputPathPage, isServerMode);
|
|
12431
12556
|
}
|
|
12432
|
-
const outputPathPageOrig =
|
|
12557
|
+
const outputPathPageOrig = import_path3.default.posix.join(
|
|
12433
12558
|
entryDirectory,
|
|
12434
12559
|
origRouteFileNoExt
|
|
12435
12560
|
);
|
|
12436
12561
|
let lambda;
|
|
12437
12562
|
function normalizeDataRoute(route) {
|
|
12438
|
-
let normalized =
|
|
12563
|
+
let normalized = import_path3.default.posix.join(entryDirectory, route);
|
|
12439
12564
|
if (nonDynamicSsg || isFallback || isOmitted) {
|
|
12440
12565
|
normalized = normalized.replace(
|
|
12441
12566
|
new RegExp(`${(0, import_escape_string_regexp.default)(origRouteFileNoExt)}.json$`),
|
|
@@ -12464,9 +12589,9 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12464
12589
|
}
|
|
12465
12590
|
if (isSharedLambdas) {
|
|
12466
12591
|
const outputSrcPathPage = normalizeIndexOutput(
|
|
12467
|
-
|
|
12592
|
+
import_path3.default.join(
|
|
12468
12593
|
"/",
|
|
12469
|
-
srcRoute == null ? outputPathPageOrig :
|
|
12594
|
+
srcRoute == null ? outputPathPageOrig : import_path3.default.posix.join(
|
|
12470
12595
|
entryDirectory,
|
|
12471
12596
|
srcRoute === "/" ? "/index" : srcRoute
|
|
12472
12597
|
)
|
|
@@ -12476,7 +12601,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12476
12601
|
const lambdaId = pageLambdaMap[outputSrcPathPage];
|
|
12477
12602
|
lambda = lambdas[lambdaId];
|
|
12478
12603
|
} else {
|
|
12479
|
-
let outputSrcPathPage = srcRoute == null ? outputPathPageOrig :
|
|
12604
|
+
let outputSrcPathPage = srcRoute == null ? outputPathPageOrig : import_path3.default.posix.join(
|
|
12480
12605
|
entryDirectory,
|
|
12481
12606
|
srcRoute === "/" ? "/index" : srcRoute
|
|
12482
12607
|
);
|
|
@@ -12583,31 +12708,46 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12583
12708
|
htmlAllowQuery = [];
|
|
12584
12709
|
}
|
|
12585
12710
|
}
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
|
|
12711
|
+
const staticMetadataFile = getSourceFileRefOfStaticMetadata(
|
|
12712
|
+
routeKey,
|
|
12713
|
+
appPathnameFilesMap
|
|
12714
|
+
);
|
|
12715
|
+
if (staticMetadataFile) {
|
|
12716
|
+
const metadataFsRef = new import_build_utils.FileFsRef({
|
|
12717
|
+
fsPath: staticMetadataFile.fsPath
|
|
12718
|
+
});
|
|
12719
|
+
const contentType = getContentTypeFromFile(staticMetadataFile);
|
|
12720
|
+
if (contentType) {
|
|
12721
|
+
metadataFsRef.contentType = contentType;
|
|
12722
|
+
}
|
|
12723
|
+
prerenders[outputPathPage] = metadataFsRef;
|
|
12724
|
+
} else {
|
|
12725
|
+
prerenders[outputPathPage] = new import_build_utils.Prerender({
|
|
12726
|
+
expiration: initialRevalidate,
|
|
12727
|
+
staleExpiration: initialExpire,
|
|
12728
|
+
lambda,
|
|
12729
|
+
allowQuery: htmlAllowQuery,
|
|
12730
|
+
fallback: htmlFallbackFsRef,
|
|
12731
|
+
group: prerenderGroup,
|
|
12732
|
+
bypassToken: prerenderManifest.bypassToken,
|
|
12733
|
+
experimentalBypassFor,
|
|
12734
|
+
initialStatus,
|
|
12735
|
+
initialHeaders,
|
|
12736
|
+
sourcePath,
|
|
12737
|
+
experimentalStreamingLambdaPath,
|
|
12738
|
+
chain,
|
|
12739
|
+
allowHeader,
|
|
12740
|
+
...isNotFound ? {
|
|
12741
|
+
initialStatus: 404
|
|
12742
|
+
} : {},
|
|
12743
|
+
...rscEnabled ? {
|
|
12744
|
+
initialHeaders: {
|
|
12745
|
+
...initialHeaders,
|
|
12746
|
+
vary: rscVaryHeader
|
|
12747
|
+
}
|
|
12748
|
+
} : {}
|
|
12749
|
+
});
|
|
12750
|
+
}
|
|
12611
12751
|
const normalizePathData = (pathData) => {
|
|
12612
12752
|
if ((srcRoute === "/" || srcRoute == "/index") && pathData.endsWith(RSC_PREFETCH_SUFFIX)) {
|
|
12613
12753
|
delete lambdas[pathData];
|
|
@@ -12657,11 +12797,15 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12657
12797
|
const contentType = `application/x-nextjs-pre-render; state-length=${postponedState.length}; origin=${JSON.stringify(
|
|
12658
12798
|
rscContentTypeHeader
|
|
12659
12799
|
)}`;
|
|
12800
|
+
let rdcRSCAllowQuery = allowQuery;
|
|
12801
|
+
if (isAppClientParamParsingEnabled && (isFallback || isBlocking)) {
|
|
12802
|
+
rdcRSCAllowQuery = [];
|
|
12803
|
+
}
|
|
12660
12804
|
prerenders[normalizePathData(outputPathData)] = new import_build_utils.Prerender({
|
|
12661
12805
|
expiration: initialRevalidate,
|
|
12662
12806
|
staleExpiration: initialExpire,
|
|
12663
12807
|
lambda,
|
|
12664
|
-
allowQuery,
|
|
12808
|
+
allowQuery: rdcRSCAllowQuery,
|
|
12665
12809
|
fallback: isFallback ? null : new import_build_utils.FileBlob({
|
|
12666
12810
|
data: postponedState,
|
|
12667
12811
|
contentType
|
|
@@ -12689,11 +12833,11 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12689
12833
|
const prefetchSegmentSuffix = routesManifest?.rsc?.prefetchSegmentSuffix;
|
|
12690
12834
|
const prefetchSegmentDirSuffix = routesManifest?.rsc?.prefetchSegmentDirSuffix;
|
|
12691
12835
|
if (isAppClientSegmentCacheEnabled && prefetchSegmentSuffix && prefetchSegmentDirSuffix && rscDidPostponeHeader && appDir) {
|
|
12692
|
-
const metaPath =
|
|
12836
|
+
const metaPath = import_path3.default.join(appDir, `${routeFileNoExt}.meta`);
|
|
12693
12837
|
if (import_fs_extra3.default.existsSync(metaPath)) {
|
|
12694
12838
|
const meta = JSON.parse(import_fs_extra3.default.readFileSync(metaPath, "utf8"));
|
|
12695
12839
|
if (typeof meta === "object" && meta !== null && "segmentPaths" in meta && typeof meta.segmentPaths === "object" && meta.segmentPaths !== null && Array.isArray(meta.segmentPaths)) {
|
|
12696
|
-
const segmentsDir =
|
|
12840
|
+
const segmentsDir = import_path3.default.join(
|
|
12697
12841
|
appDir,
|
|
12698
12842
|
routeFileNoExt + prefetchSegmentDirSuffix
|
|
12699
12843
|
);
|
|
@@ -12702,13 +12846,13 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12702
12846
|
segmentAllowQuery = [];
|
|
12703
12847
|
}
|
|
12704
12848
|
for (const segmentPath of meta.segmentPaths) {
|
|
12705
|
-
const outputSegmentPath =
|
|
12849
|
+
const outputSegmentPath = import_path3.default.join(
|
|
12706
12850
|
outputPathPage + prefetchSegmentDirSuffix,
|
|
12707
12851
|
segmentPath
|
|
12708
12852
|
) + prefetchSegmentSuffix;
|
|
12709
12853
|
let fallback = null;
|
|
12710
12854
|
if (segmentAllowQuery && segmentAllowQuery.length === 0) {
|
|
12711
|
-
const fsPath =
|
|
12855
|
+
const fsPath = import_path3.default.join(
|
|
12712
12856
|
segmentsDir,
|
|
12713
12857
|
segmentPath + prefetchSegmentSuffix
|
|
12714
12858
|
);
|
|
@@ -12756,7 +12900,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
|
|
|
12756
12900
|
routesManifest,
|
|
12757
12901
|
locale2
|
|
12758
12902
|
);
|
|
12759
|
-
let localeOutputPathPage =
|
|
12903
|
+
let localeOutputPathPage = import_path3.default.posix.join(
|
|
12760
12904
|
entryDirectory,
|
|
12761
12905
|
localeRouteFileNoExt
|
|
12762
12906
|
);
|
|
@@ -12804,18 +12948,18 @@ async function getStaticFiles(entryPath, entryDirectory, outputDirectory) {
|
|
|
12804
12948
|
console.time(collectLabel);
|
|
12805
12949
|
const nextStaticFiles = await (0, import_build_utils.glob)(
|
|
12806
12950
|
"**",
|
|
12807
|
-
|
|
12951
|
+
import_path3.default.join(entryPath, outputDirectory, "static")
|
|
12808
12952
|
);
|
|
12809
|
-
const staticFolderFiles = await (0, import_build_utils.glob)("**",
|
|
12953
|
+
const staticFolderFiles = await (0, import_build_utils.glob)("**", import_path3.default.join(entryPath, "static"));
|
|
12810
12954
|
let publicFolderFiles = {};
|
|
12811
12955
|
let publicFolderPath;
|
|
12812
|
-
if (await import_fs_extra3.default.pathExists(
|
|
12813
|
-
publicFolderPath =
|
|
12956
|
+
if (await import_fs_extra3.default.pathExists(import_path3.default.join(entryPath, "public"))) {
|
|
12957
|
+
publicFolderPath = import_path3.default.join(entryPath, "public");
|
|
12814
12958
|
} else if (
|
|
12815
12959
|
// check at the same level as the output directory also
|
|
12816
|
-
await import_fs_extra3.default.pathExists(
|
|
12960
|
+
await import_fs_extra3.default.pathExists(import_path3.default.join(entryPath, outputDirectory, "../public"))
|
|
12817
12961
|
) {
|
|
12818
|
-
publicFolderPath =
|
|
12962
|
+
publicFolderPath = import_path3.default.join(entryPath, outputDirectory, "../public");
|
|
12819
12963
|
}
|
|
12820
12964
|
if (publicFolderPath) {
|
|
12821
12965
|
(0, import_build_utils.debug)(`Using public folder at ${publicFolderPath}`);
|
|
@@ -12827,13 +12971,16 @@ async function getStaticFiles(entryPath, entryDirectory, outputDirectory) {
|
|
|
12827
12971
|
const staticDirectoryFiles = {};
|
|
12828
12972
|
const publicDirectoryFiles = {};
|
|
12829
12973
|
for (const file of Object.keys(nextStaticFiles)) {
|
|
12830
|
-
|
|
12974
|
+
const outputPath = import_path3.default.posix.join(entryDirectory, `_next/static/${file}`);
|
|
12975
|
+
staticFiles[outputPath] = nextStaticFiles[file];
|
|
12831
12976
|
}
|
|
12832
12977
|
for (const file of Object.keys(staticFolderFiles)) {
|
|
12833
|
-
|
|
12978
|
+
const outputPath = import_path3.default.posix.join(entryDirectory, "static", file);
|
|
12979
|
+
staticDirectoryFiles[outputPath] = staticFolderFiles[file];
|
|
12834
12980
|
}
|
|
12835
12981
|
for (const file of Object.keys(publicFolderFiles)) {
|
|
12836
|
-
|
|
12982
|
+
const outputPath = import_path3.default.posix.join(entryDirectory, file);
|
|
12983
|
+
publicDirectoryFiles[outputPath] = publicFolderFiles[file];
|
|
12837
12984
|
}
|
|
12838
12985
|
console.timeEnd(collectLabel);
|
|
12839
12986
|
return {
|
|
@@ -12855,17 +13002,17 @@ function pathnameToOutputName(entryDirectory, pathname) {
|
|
|
12855
13002
|
if (pathname === "/") {
|
|
12856
13003
|
pathname = "/index";
|
|
12857
13004
|
}
|
|
12858
|
-
return
|
|
13005
|
+
return import_path3.default.posix.join(entryDirectory, pathname);
|
|
12859
13006
|
}
|
|
12860
13007
|
function getPostponeResumePathname(pathname) {
|
|
12861
13008
|
if (pathname === "/")
|
|
12862
13009
|
pathname = "/index";
|
|
12863
|
-
return
|
|
13010
|
+
return import_path3.default.posix.join("_next/postponed/resume", pathname);
|
|
12864
13011
|
}
|
|
12865
13012
|
function getPostponeResumeOutput(entryDirectory, pathname) {
|
|
12866
13013
|
if (pathname === "/")
|
|
12867
13014
|
pathname = "/index";
|
|
12868
|
-
return
|
|
13015
|
+
return import_path3.default.posix.join(entryDirectory, "_next/postponed/resume", pathname);
|
|
12869
13016
|
}
|
|
12870
13017
|
function updateRouteSrc(route, index, manifestItems) {
|
|
12871
13018
|
if (route.src) {
|
|
@@ -12877,7 +13024,7 @@ async function getPrivateOutputs(dir, entries) {
|
|
|
12877
13024
|
const files = {};
|
|
12878
13025
|
const routes = [];
|
|
12879
13026
|
for (const [existingFile, outputFile] of Object.entries(entries)) {
|
|
12880
|
-
const fsPath =
|
|
13027
|
+
const fsPath = import_path3.default.join(dir, existingFile);
|
|
12881
13028
|
try {
|
|
12882
13029
|
const { mode, size } = await (0, import_fs_extra3.stat)(fsPath);
|
|
12883
13030
|
if (size > 30 * 1024 * 1024) {
|
|
@@ -12997,21 +13144,21 @@ async function getNodeMiddleware({
|
|
|
12997
13144
|
sourceFile,
|
|
12998
13145
|
config
|
|
12999
13146
|
});
|
|
13000
|
-
const middlewareFile =
|
|
13147
|
+
const middlewareFile = import_path3.default.join(
|
|
13001
13148
|
entryPath,
|
|
13002
13149
|
outputDirectory,
|
|
13003
13150
|
"server",
|
|
13004
13151
|
"middleware.js"
|
|
13005
13152
|
);
|
|
13006
13153
|
const middlewareTrace = `${middlewareFile}.nft.json`;
|
|
13007
|
-
const middlewareTraceDir =
|
|
13154
|
+
const middlewareTraceDir = import_path3.default.dirname(middlewareTrace);
|
|
13008
13155
|
const { files } = JSON.parse(await import_fs_extra3.default.readFile(middlewareTrace, "utf8"));
|
|
13009
13156
|
const fileList = [];
|
|
13010
|
-
const normalizedBaseDir = `${baseDir}${baseDir.endsWith(
|
|
13157
|
+
const normalizedBaseDir = `${baseDir}${baseDir.endsWith(import_path3.default.sep) ? "" : import_path3.default.sep}`;
|
|
13011
13158
|
files.forEach((file) => {
|
|
13012
|
-
const absolutePath =
|
|
13159
|
+
const absolutePath = import_path3.default.join(middlewareTraceDir, file);
|
|
13013
13160
|
if (absolutePath.startsWith(normalizedBaseDir)) {
|
|
13014
|
-
fileList.push(
|
|
13161
|
+
fileList.push(import_path3.default.relative(baseDir, absolutePath));
|
|
13015
13162
|
} else {
|
|
13016
13163
|
console.log("outside base dir", absolutePath);
|
|
13017
13164
|
}
|
|
@@ -13024,25 +13171,25 @@ async function getNodeMiddleware({
|
|
|
13024
13171
|
)
|
|
13025
13172
|
)).filter((entry) => !!entry)
|
|
13026
13173
|
);
|
|
13027
|
-
const absoluteOutputDirectory =
|
|
13028
|
-
const launcherData = (await import_fs_extra3.default.readFile(
|
|
13174
|
+
const absoluteOutputDirectory = import_path3.default.posix.join(entryPath, outputDirectory);
|
|
13175
|
+
const launcherData = (await import_fs_extra3.default.readFile(import_path3.default.join(__dirname, "middleware-launcher.js"), "utf8")).replace(
|
|
13029
13176
|
/(?:var|const) conf = __NEXT_CONFIG__/,
|
|
13030
13177
|
`const conf = ${JSON.stringify({
|
|
13031
13178
|
...requiredServerFilesManifest.config,
|
|
13032
|
-
distDir:
|
|
13179
|
+
distDir: import_path3.default.relative(projectDir, absoluteOutputDirectory)
|
|
13033
13180
|
})}`
|
|
13034
13181
|
).replace(
|
|
13035
13182
|
"__NEXT_MIDDLEWARE_PATH__",
|
|
13036
|
-
"./" +
|
|
13037
|
-
|
|
13183
|
+
"./" + import_path3.default.posix.join(
|
|
13184
|
+
import_path3.default.posix.relative(projectDir, absoluteOutputDirectory),
|
|
13038
13185
|
`server/middleware.js`
|
|
13039
13186
|
)
|
|
13040
13187
|
);
|
|
13041
13188
|
const lambda = new import_build_utils.NodejsLambda({
|
|
13042
13189
|
...vercelConfigOpts,
|
|
13043
13190
|
runtime: nodeVersion,
|
|
13044
|
-
handler:
|
|
13045
|
-
|
|
13191
|
+
handler: import_path3.default.join(
|
|
13192
|
+
import_path3.default.relative(baseDir, projectDir),
|
|
13046
13193
|
"___next_launcher.cjs"
|
|
13047
13194
|
),
|
|
13048
13195
|
useWebApi: true,
|
|
@@ -13054,10 +13201,10 @@ async function getNodeMiddleware({
|
|
|
13054
13201
|
},
|
|
13055
13202
|
files: {
|
|
13056
13203
|
...tracedFiles,
|
|
13057
|
-
[
|
|
13204
|
+
[import_path3.default.relative(baseDir, middlewareFile)]: new import_build_utils.FileFsRef({
|
|
13058
13205
|
fsPath: middlewareFile
|
|
13059
13206
|
}),
|
|
13060
|
-
[
|
|
13207
|
+
[import_path3.default.join(import_path3.default.relative(baseDir, projectDir), "___next_launcher.cjs")]: new import_build_utils.FileBlob({ data: launcherData })
|
|
13061
13208
|
}
|
|
13062
13209
|
});
|
|
13063
13210
|
return {
|
|
@@ -13113,7 +13260,7 @@ async function getMiddlewareBundle({
|
|
|
13113
13260
|
i18n: routesManifest.i18n
|
|
13114
13261
|
}
|
|
13115
13262
|
},
|
|
13116
|
-
|
|
13263
|
+
import_path3.default.resolve(entryPath, outputDirectory),
|
|
13117
13264
|
edgeFunction.wasm
|
|
13118
13265
|
);
|
|
13119
13266
|
return {
|
|
@@ -13127,7 +13274,7 @@ async function getMiddlewareBundle({
|
|
|
13127
13274
|
);
|
|
13128
13275
|
const wasmFiles = (edgeFunction.wasm ?? []).reduce(
|
|
13129
13276
|
(acc, { filePath, name }) => {
|
|
13130
|
-
const fullFilePath =
|
|
13277
|
+
const fullFilePath = import_path3.default.join(
|
|
13131
13278
|
entryPath,
|
|
13132
13279
|
outputDirectory,
|
|
13133
13280
|
filePath
|
|
@@ -13143,7 +13290,7 @@ async function getMiddlewareBundle({
|
|
|
13143
13290
|
);
|
|
13144
13291
|
const assetFiles = (edgeFunction.assets ?? []).reduce(
|
|
13145
13292
|
(acc, { filePath, name }) => {
|
|
13146
|
-
const fullFilePath =
|
|
13293
|
+
const fullFilePath = import_path3.default.join(
|
|
13147
13294
|
entryPath,
|
|
13148
13295
|
outputDirectory,
|
|
13149
13296
|
filePath
|
|
@@ -13213,7 +13360,7 @@ async function getMiddlewareBundle({
|
|
|
13213
13360
|
}
|
|
13214
13361
|
if (routesManifest?.basePath) {
|
|
13215
13362
|
const isAppPathRoute = !!appPathRoutesManifest[shortPath];
|
|
13216
|
-
shortPath =
|
|
13363
|
+
shortPath = import_path3.default.posix.join(
|
|
13217
13364
|
"./",
|
|
13218
13365
|
routesManifest?.basePath,
|
|
13219
13366
|
shortPath.replace(/^\//, "")
|
|
@@ -13262,7 +13409,7 @@ async function getMiddlewareBundle({
|
|
|
13262
13409
|
};
|
|
13263
13410
|
}
|
|
13264
13411
|
async function getFunctionsConfigManifest(entryPath, outputDirectory) {
|
|
13265
|
-
const functionConfigManifestPath =
|
|
13412
|
+
const functionConfigManifestPath = import_path3.default.join(
|
|
13266
13413
|
entryPath,
|
|
13267
13414
|
outputDirectory,
|
|
13268
13415
|
"./server/functions-config-manifest.json"
|
|
@@ -13277,7 +13424,7 @@ async function getFunctionsConfigManifest(entryPath, outputDirectory) {
|
|
|
13277
13424
|
return manifest.version === 1 ? manifest : void 0;
|
|
13278
13425
|
}
|
|
13279
13426
|
async function getMiddlewareManifest(entryPath, outputDirectory) {
|
|
13280
|
-
const middlewareManifestPath =
|
|
13427
|
+
const middlewareManifestPath = import_path3.default.join(
|
|
13281
13428
|
entryPath,
|
|
13282
13429
|
outputDirectory,
|
|
13283
13430
|
"./server/middleware-manifest.json"
|
|
@@ -13406,7 +13553,7 @@ function isApiPage(page) {
|
|
|
13406
13553
|
return page.replace(/\\/g, "/").match(/(serverless|server)\/pages\/api(\/|\.js$)/);
|
|
13407
13554
|
}
|
|
13408
13555
|
async function getVariantsManifest(entryPath, outputDirectory) {
|
|
13409
|
-
const pathVariantsManifest =
|
|
13556
|
+
const pathVariantsManifest = import_path3.default.join(
|
|
13410
13557
|
entryPath,
|
|
13411
13558
|
outputDirectory,
|
|
13412
13559
|
"variants-manifest.json"
|
|
@@ -13418,7 +13565,7 @@ async function getVariantsManifest(entryPath, outputDirectory) {
|
|
|
13418
13565
|
return variantsManifest;
|
|
13419
13566
|
}
|
|
13420
13567
|
async function getServerlessPages(params) {
|
|
13421
|
-
const appDir =
|
|
13568
|
+
const appDir = import_path3.default.join(params.pagesDir, "../app");
|
|
13422
13569
|
const [pages, appPaths, middlewareManifest] = await Promise.all([
|
|
13423
13570
|
(0, import_build_utils.glob)("**/!(_middleware).js", params.pagesDir),
|
|
13424
13571
|
params.appPathRoutesManifest ? Promise.all([
|
|
@@ -13433,11 +13580,11 @@ async function getServerlessPages(params) {
|
|
|
13433
13580
|
for (const [entry, normalizedEntry] of Object.entries(
|
|
13434
13581
|
params.appPathRoutesManifest
|
|
13435
13582
|
)) {
|
|
13436
|
-
const normalizedPath = `${
|
|
13583
|
+
const normalizedPath = `${import_path3.default.join(
|
|
13437
13584
|
".",
|
|
13438
13585
|
normalizedEntry === "/" ? "/index" : normalizedEntry
|
|
13439
13586
|
)}.js`;
|
|
13440
|
-
const globPath = `${
|
|
13587
|
+
const globPath = `${import_path3.default.posix.join(".", entry)}.js`;
|
|
13441
13588
|
if (appPaths[globPath]) {
|
|
13442
13589
|
normalizedAppPaths[normalizedPath] = appPaths[globPath];
|
|
13443
13590
|
}
|
|
@@ -13473,7 +13620,7 @@ function getHTMLPostponedState({
|
|
|
13473
13620
|
appDir,
|
|
13474
13621
|
routeFileNoExt
|
|
13475
13622
|
}) {
|
|
13476
|
-
const metaPath =
|
|
13623
|
+
const metaPath = import_path3.default.join(appDir, `${routeFileNoExt}.meta`);
|
|
13477
13624
|
if (!import_fs_extra3.default.existsSync(metaPath)) {
|
|
13478
13625
|
return null;
|
|
13479
13626
|
}
|
|
@@ -13484,7 +13631,7 @@ function getHTMLPostponedState({
|
|
|
13484
13631
|
return meta.postponed;
|
|
13485
13632
|
}
|
|
13486
13633
|
async function getServerActionMetaRoutes(distDir) {
|
|
13487
|
-
const manifestPath =
|
|
13634
|
+
const manifestPath = import_path3.default.join(
|
|
13488
13635
|
distDir,
|
|
13489
13636
|
"server",
|
|
13490
13637
|
"server-reference-manifest.json"
|
|
@@ -13582,8 +13729,8 @@ async function createServerlessConfig(workPath, entryPath, nextVersion) {
|
|
|
13582
13729
|
} catch (_ignored) {
|
|
13583
13730
|
}
|
|
13584
13731
|
}
|
|
13585
|
-
const primaryConfigPath =
|
|
13586
|
-
const secondaryConfigPath =
|
|
13732
|
+
const primaryConfigPath = import_path4.default.join(entryPath, "next.config.js");
|
|
13733
|
+
const secondaryConfigPath = import_path4.default.join(workPath, "next.config.js");
|
|
13587
13734
|
const backupConfigName = `next.config.__vercel_builder_backup__.js`;
|
|
13588
13735
|
const hasPrimaryConfig = import_fs_extra4.default.existsSync(primaryConfigPath);
|
|
13589
13736
|
const hasSecondaryConfig = import_fs_extra4.default.existsSync(secondaryConfigPath);
|
|
@@ -13591,13 +13738,13 @@ async function createServerlessConfig(workPath, entryPath, nextVersion) {
|
|
|
13591
13738
|
let backupConfigPath;
|
|
13592
13739
|
if (hasPrimaryConfig) {
|
|
13593
13740
|
configPath = primaryConfigPath;
|
|
13594
|
-
backupConfigPath =
|
|
13741
|
+
backupConfigPath = import_path4.default.join(entryPath, backupConfigName);
|
|
13595
13742
|
} else if (hasSecondaryConfig) {
|
|
13596
13743
|
configPath = secondaryConfigPath;
|
|
13597
|
-
backupConfigPath =
|
|
13744
|
+
backupConfigPath = import_path4.default.join(workPath, backupConfigName);
|
|
13598
13745
|
} else {
|
|
13599
13746
|
configPath = primaryConfigPath;
|
|
13600
|
-
backupConfigPath =
|
|
13747
|
+
backupConfigPath = import_path4.default.join(entryPath, backupConfigName);
|
|
13601
13748
|
}
|
|
13602
13749
|
if (import_fs_extra4.default.existsSync(configPath)) {
|
|
13603
13750
|
await import_fs_extra4.default.rename(configPath, backupConfigPath);
|
|
@@ -13947,7 +14094,7 @@ var legacy_versions_default = [
|
|
|
13947
14094
|
];
|
|
13948
14095
|
|
|
13949
14096
|
// src/server-build.ts
|
|
13950
|
-
var
|
|
14097
|
+
var import_path5 = __toESM(require("path"));
|
|
13951
14098
|
var import_semver3 = __toESM(require_semver());
|
|
13952
14099
|
var import_async_sema2 = __toESM(require_lib());
|
|
13953
14100
|
var import_build_utils2 = require("@vercel/build-utils");
|
|
@@ -13990,6 +14137,7 @@ async function serverBuild({
|
|
|
13990
14137
|
config = {},
|
|
13991
14138
|
functionsConfigManifest,
|
|
13992
14139
|
privateOutputs,
|
|
14140
|
+
files,
|
|
13993
14141
|
baseDir,
|
|
13994
14142
|
workPath,
|
|
13995
14143
|
entryPath,
|
|
@@ -14053,7 +14201,7 @@ async function serverBuild({
|
|
|
14053
14201
|
nextVersion,
|
|
14054
14202
|
EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION
|
|
14055
14203
|
);
|
|
14056
|
-
const projectDir = requiredServerFilesManifest.relativeAppDir ?
|
|
14204
|
+
const projectDir = requiredServerFilesManifest.relativeAppDir ? import_path5.default.join(baseDir, requiredServerFilesManifest.relativeAppDir) : requiredServerFilesManifest.appDir || entryPath;
|
|
14057
14205
|
const inversedAppPathManifest = {};
|
|
14058
14206
|
if (appPathRoutesManifest) {
|
|
14059
14207
|
for (const ogRoute of Object.keys(appPathRoutesManifest)) {
|
|
@@ -14065,7 +14213,7 @@ async function serverBuild({
|
|
|
14065
14213
|
let appDir = null;
|
|
14066
14214
|
const rscHeader = routesManifest.rsc?.header?.toLowerCase() || "__rsc__";
|
|
14067
14215
|
if (appPathRoutesManifest) {
|
|
14068
|
-
appDir =
|
|
14216
|
+
appDir = import_path5.default.join(pagesDir, "../app");
|
|
14069
14217
|
appBuildTraces = await (0, import_build_utils2.glob)("**/*.js.nft.json", appDir);
|
|
14070
14218
|
appRscPrefetches = isAppPPREnabled ? {} : await (0, import_build_utils2.glob)(`**/*${RSC_PREFETCH_SUFFIX}`, appDir);
|
|
14071
14219
|
const rscContentTypeHeader = routesManifest?.rsc?.contentTypeHeader || RSC_CONTENT_TYPE;
|
|
@@ -14174,7 +14322,7 @@ async function serverBuild({
|
|
|
14174
14322
|
CORRECT_MIDDLEWARE_ORDER_VERSION
|
|
14175
14323
|
);
|
|
14176
14324
|
const isCorrectManifests = !experimentalAllowBundling && import_semver3.default.gte(nextVersion, CORRECTED_MANIFESTS_VERSION);
|
|
14177
|
-
let hasStatic500 = !!staticPages[
|
|
14325
|
+
let hasStatic500 = !!staticPages[import_path5.default.posix.join(entryDirectory, "500")];
|
|
14178
14326
|
if (lambdaPageKeys.length === 0) {
|
|
14179
14327
|
throw new import_build_utils2.NowBuildError({
|
|
14180
14328
|
code: "NEXT_NO_SERVER_PAGES",
|
|
@@ -14188,12 +14336,12 @@ async function serverBuild({
|
|
|
14188
14336
|
};
|
|
14189
14337
|
const { i18n } = routesManifest;
|
|
14190
14338
|
const hasPages404 = routesManifest.pages404;
|
|
14191
|
-
let static404Page = staticPages[
|
|
14192
|
-
if (!static404Page && i18n && staticPages[
|
|
14193
|
-
static404Page =
|
|
14339
|
+
let static404Page = staticPages[import_path5.default.posix.join(entryDirectory, "404")] && hasPages404 ? import_path5.default.posix.join(entryDirectory, "404") : staticPages[import_path5.default.posix.join(entryDirectory, "_errors/404")] ? import_path5.default.posix.join(entryDirectory, "_errors/404") : void 0;
|
|
14340
|
+
if (!static404Page && i18n && staticPages[import_path5.default.posix.join(entryDirectory, i18n.defaultLocale, "404")]) {
|
|
14341
|
+
static404Page = import_path5.default.posix.join(entryDirectory, i18n.defaultLocale, "404");
|
|
14194
14342
|
}
|
|
14195
14343
|
if (!hasStatic500 && i18n) {
|
|
14196
|
-
hasStatic500 = !!staticPages[
|
|
14344
|
+
hasStatic500 = !!staticPages[import_path5.default.posix.join(entryDirectory, i18n.defaultLocale, "500")];
|
|
14197
14345
|
}
|
|
14198
14346
|
const lstatSema = new import_async_sema2.Sema(25);
|
|
14199
14347
|
const lstatResults = {};
|
|
@@ -14255,7 +14403,7 @@ async function serverBuild({
|
|
|
14255
14403
|
try {
|
|
14256
14404
|
nextServerBuildTrace = JSON.parse(
|
|
14257
14405
|
await import_fs_extra5.default.readFile(
|
|
14258
|
-
|
|
14406
|
+
import_path5.default.join(
|
|
14259
14407
|
entryPath,
|
|
14260
14408
|
outputDirectory,
|
|
14261
14409
|
useBundledServer ? "next-minimal-server.js.nft.json" : "next-server.js.nft.json"
|
|
@@ -14268,7 +14416,7 @@ async function serverBuild({
|
|
|
14268
14416
|
try {
|
|
14269
14417
|
instrumentationHookBuildTrace = JSON.parse(
|
|
14270
14418
|
await import_fs_extra5.default.readFile(
|
|
14271
|
-
|
|
14419
|
+
import_path5.default.join(
|
|
14272
14420
|
entryPath,
|
|
14273
14421
|
outputDirectory,
|
|
14274
14422
|
"server",
|
|
@@ -14281,9 +14429,9 @@ async function serverBuild({
|
|
|
14281
14429
|
}
|
|
14282
14430
|
if (nextServerBuildTrace) {
|
|
14283
14431
|
initialFileList = nextServerBuildTrace.files.map((file) => {
|
|
14284
|
-
return
|
|
14432
|
+
return import_path5.default.relative(
|
|
14285
14433
|
baseDir,
|
|
14286
|
-
|
|
14434
|
+
import_path5.default.join(entryPath, outputDirectory, file)
|
|
14287
14435
|
);
|
|
14288
14436
|
});
|
|
14289
14437
|
initialFileReasons = /* @__PURE__ */ new Map();
|
|
@@ -14297,7 +14445,7 @@ async function serverBuild({
|
|
|
14297
14445
|
processCwd: entryPath,
|
|
14298
14446
|
ignore: [
|
|
14299
14447
|
...requiredServerFilesManifest.ignore.map(
|
|
14300
|
-
(file) =>
|
|
14448
|
+
(file) => import_path5.default.join(entryPath, file)
|
|
14301
14449
|
),
|
|
14302
14450
|
"node_modules/next/dist/pages/**/*",
|
|
14303
14451
|
`node_modules/${getNextServerPath(
|
|
@@ -14317,9 +14465,9 @@ async function serverBuild({
|
|
|
14317
14465
|
if (instrumentationHookBuildTrace) {
|
|
14318
14466
|
initialFileList = initialFileList.concat(
|
|
14319
14467
|
instrumentationHookBuildTrace.files.map((file) => {
|
|
14320
|
-
return
|
|
14468
|
+
return import_path5.default.relative(
|
|
14321
14469
|
baseDir,
|
|
14322
|
-
|
|
14470
|
+
import_path5.default.join(entryPath, outputDirectory, "server", file)
|
|
14323
14471
|
);
|
|
14324
14472
|
})
|
|
14325
14473
|
);
|
|
@@ -14372,21 +14520,21 @@ async function serverBuild({
|
|
|
14372
14520
|
}
|
|
14373
14521
|
});
|
|
14374
14522
|
const requiredFiles = {};
|
|
14375
|
-
requiredFiles[
|
|
14523
|
+
requiredFiles[import_path5.default.relative(baseDir, nextServerFile)] = new import_build_utils2.FileFsRef({
|
|
14376
14524
|
mode: (await import_fs_extra5.default.lstat(nextServerFile)).mode,
|
|
14377
14525
|
fsPath: nextServerFile
|
|
14378
14526
|
});
|
|
14379
14527
|
if (static404Pages.size > 0) {
|
|
14380
14528
|
if (i18n) {
|
|
14381
14529
|
for (const locale of i18n.locales) {
|
|
14382
|
-
const static404Page2 =
|
|
14530
|
+
const static404Page2 = import_path5.default.posix.join(entryDirectory, locale, "404");
|
|
14383
14531
|
static404Pages.add(static404Page2);
|
|
14384
14532
|
}
|
|
14385
14533
|
}
|
|
14386
14534
|
for (const static404Page2 of static404Pages) {
|
|
14387
14535
|
let static404File = staticPages[static404Page2];
|
|
14388
14536
|
if (!static404File) {
|
|
14389
|
-
const static404FilePath =
|
|
14537
|
+
const static404FilePath = import_path5.default.join(
|
|
14390
14538
|
pagesDir,
|
|
14391
14539
|
`${static404Page2}.html`
|
|
14392
14540
|
);
|
|
@@ -14397,7 +14545,7 @@ async function serverBuild({
|
|
|
14397
14545
|
}
|
|
14398
14546
|
}
|
|
14399
14547
|
if (static404File) {
|
|
14400
|
-
requiredFiles[
|
|
14548
|
+
requiredFiles[import_path5.default.relative(baseDir, static404File.fsPath)] = static404File;
|
|
14401
14549
|
}
|
|
14402
14550
|
}
|
|
14403
14551
|
}
|
|
@@ -14405,31 +14553,31 @@ async function serverBuild({
|
|
|
14405
14553
|
for (const file of await import_fs_extra5.default.readdir(workPath)) {
|
|
14406
14554
|
const isEnv = file === ".env" || file.startsWith(".env.");
|
|
14407
14555
|
if (isEnv) {
|
|
14408
|
-
const statResult = await import_fs_extra5.default.lstat(
|
|
14556
|
+
const statResult = await import_fs_extra5.default.lstat(import_path5.default.join(workPath, file));
|
|
14409
14557
|
if (statResult.isFile()) {
|
|
14410
14558
|
envFiles.push(file);
|
|
14411
14559
|
}
|
|
14412
14560
|
}
|
|
14413
14561
|
}
|
|
14414
14562
|
for (const envFile of envFiles) {
|
|
14415
|
-
requiredFiles[
|
|
14416
|
-
fsPath:
|
|
14563
|
+
requiredFiles[import_path5.default.join(import_path5.default.relative(baseDir, entryPath), envFile)] = new import_build_utils2.FileFsRef({
|
|
14564
|
+
fsPath: import_path5.default.join(workPath, envFile)
|
|
14417
14565
|
});
|
|
14418
14566
|
}
|
|
14419
14567
|
await Promise.all(
|
|
14420
14568
|
requiredServerFilesManifest.files.map(async (file) => {
|
|
14421
14569
|
await lstatSema.acquire();
|
|
14422
|
-
let fsPath =
|
|
14570
|
+
let fsPath = import_path5.default.join(
|
|
14423
14571
|
entryPath,
|
|
14424
14572
|
// remove last part of outputDirectory `.next` since this is already
|
|
14425
14573
|
// included in the file path
|
|
14426
|
-
|
|
14574
|
+
import_path5.default.join(outputDirectory, ".."),
|
|
14427
14575
|
file
|
|
14428
14576
|
);
|
|
14429
14577
|
if (projectDir) {
|
|
14430
|
-
fsPath =
|
|
14578
|
+
fsPath = import_path5.default.join(projectDir, file);
|
|
14431
14579
|
}
|
|
14432
|
-
const relativePath =
|
|
14580
|
+
const relativePath = import_path5.default.relative(baseDir, fsPath);
|
|
14433
14581
|
const { mode } = await import_fs_extra5.default.lstat(fsPath);
|
|
14434
14582
|
lstatSema.release();
|
|
14435
14583
|
requiredFiles[relativePath] = new import_build_utils2.FileFsRef({
|
|
@@ -14479,16 +14627,16 @@ async function serverBuild({
|
|
|
14479
14627
|
});
|
|
14480
14628
|
}
|
|
14481
14629
|
const launcherData = await import_fs_extra5.default.readFile(
|
|
14482
|
-
|
|
14630
|
+
import_path5.default.join(__dirname, "server-launcher.js"),
|
|
14483
14631
|
"utf8"
|
|
14484
14632
|
);
|
|
14485
14633
|
let launcher = launcherData.replace(
|
|
14486
14634
|
/(?:var|const) conf = __NEXT_CONFIG__/,
|
|
14487
14635
|
`const conf = ${JSON.stringify({
|
|
14488
14636
|
...requiredServerFilesManifest.config,
|
|
14489
|
-
distDir:
|
|
14637
|
+
distDir: import_path5.default.relative(
|
|
14490
14638
|
projectDir,
|
|
14491
|
-
|
|
14639
|
+
import_path5.default.join(entryPath, outputDirectory)
|
|
14492
14640
|
),
|
|
14493
14641
|
compress: false
|
|
14494
14642
|
})}`
|
|
@@ -14500,10 +14648,10 @@ async function serverBuild({
|
|
|
14500
14648
|
"// @preserve pre-next-server-target",
|
|
14501
14649
|
`process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = "${requiredServerFilesManifest.config?.experimental?.serverActions ? "experimental" : "next"}"`
|
|
14502
14650
|
);
|
|
14503
|
-
if (entryDirectory !== "." &&
|
|
14651
|
+
if (entryDirectory !== "." && import_path5.default.posix.join("/", entryDirectory) !== routesManifest.basePath) {
|
|
14504
14652
|
launcher = launcher.replace(
|
|
14505
14653
|
"// @preserve entryDirectory handler",
|
|
14506
|
-
`req.url = req.url.replace(/^${
|
|
14654
|
+
`req.url = req.url.replace(/^${import_path5.default.posix.join("/", entryDirectory).replace(/\//g, "\\/")}/, '')`
|
|
14507
14655
|
);
|
|
14508
14656
|
}
|
|
14509
14657
|
const pageTraces = {};
|
|
@@ -14520,7 +14668,7 @@ async function serverBuild({
|
|
|
14520
14668
|
let originalPagePath = page;
|
|
14521
14669
|
if (appDir && lambdaAppPaths[page]) {
|
|
14522
14670
|
const { fsPath } = lambdaAppPaths[page];
|
|
14523
|
-
originalPagePath =
|
|
14671
|
+
originalPagePath = import_path5.default.relative(appDir, fsPath);
|
|
14524
14672
|
}
|
|
14525
14673
|
return originalPagePath;
|
|
14526
14674
|
};
|
|
@@ -14561,7 +14709,7 @@ ${JSON.stringify(
|
|
|
14561
14709
|
let fileList = [];
|
|
14562
14710
|
let reasons;
|
|
14563
14711
|
if (pageBuildTrace) {
|
|
14564
|
-
const { files } = JSON.parse(
|
|
14712
|
+
const { files: files2 } = JSON.parse(
|
|
14565
14713
|
await import_fs_extra5.default.readFile(pageBuildTrace.fsPath, "utf8")
|
|
14566
14714
|
);
|
|
14567
14715
|
const isAppPath = appDir && lambdaAppPaths[page];
|
|
@@ -14570,9 +14718,9 @@ ${JSON.stringify(
|
|
|
14570
14718
|
".__sc_client__.js"
|
|
14571
14719
|
) : null;
|
|
14572
14720
|
if (serverComponentFile && await import_fs_extra5.default.pathExists(serverComponentFile)) {
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14721
|
+
files2.push(
|
|
14722
|
+
import_path5.default.relative(
|
|
14723
|
+
import_path5.default.dirname(pageBuildTrace.fsPath),
|
|
14576
14724
|
serverComponentFile
|
|
14577
14725
|
)
|
|
14578
14726
|
);
|
|
@@ -14580,25 +14728,25 @@ ${JSON.stringify(
|
|
|
14580
14728
|
const scTrace = JSON.parse(
|
|
14581
14729
|
await import_fs_extra5.default.readFile(`${serverComponentFile}.nft.json`, "utf8")
|
|
14582
14730
|
);
|
|
14583
|
-
scTrace.files.forEach((file) =>
|
|
14731
|
+
scTrace.files.forEach((file) => files2.push(file));
|
|
14584
14732
|
} catch (err) {
|
|
14585
14733
|
}
|
|
14586
14734
|
}
|
|
14587
14735
|
fileList = [];
|
|
14588
14736
|
const curPagesDir = isAppPath && appDir ? appDir : pagesDir;
|
|
14589
|
-
const pageDir =
|
|
14590
|
-
const normalizedBaseDir = `${baseDir}${baseDir.endsWith(
|
|
14591
|
-
|
|
14592
|
-
const absolutePath =
|
|
14737
|
+
const pageDir = import_path5.default.dirname(import_path5.default.join(curPagesDir, originalPagePath));
|
|
14738
|
+
const normalizedBaseDir = `${baseDir}${baseDir.endsWith(import_path5.default.sep) ? "" : import_path5.default.sep}`;
|
|
14739
|
+
files2.forEach((file) => {
|
|
14740
|
+
const absolutePath = import_path5.default.join(pageDir, file);
|
|
14593
14741
|
if (absolutePath.startsWith(normalizedBaseDir)) {
|
|
14594
|
-
fileList.push(
|
|
14742
|
+
fileList.push(import_path5.default.relative(baseDir, absolutePath));
|
|
14595
14743
|
}
|
|
14596
14744
|
});
|
|
14597
14745
|
reasons = /* @__PURE__ */ new Map();
|
|
14598
14746
|
} else {
|
|
14599
14747
|
const lambdaPage = lambdaPages[page];
|
|
14600
14748
|
fileList = Array.from(
|
|
14601
|
-
parentFilesMap?.get(
|
|
14749
|
+
parentFilesMap?.get(import_path5.default.relative(baseDir, lambdaPage.fsPath)) || []
|
|
14602
14750
|
);
|
|
14603
14751
|
reasons = traceResult?.reasons || /* @__PURE__ */ new Map();
|
|
14604
14752
|
}
|
|
@@ -14773,8 +14921,8 @@ ${JSON.stringify(
|
|
|
14773
14921
|
...internalPages,
|
|
14774
14922
|
...group.isAppRouter && appNotFoundTraces ? ["_not-found.js"] : []
|
|
14775
14923
|
]) {
|
|
14776
|
-
const pageFileName =
|
|
14777
|
-
|
|
14924
|
+
const pageFileName = import_path5.default.normalize(
|
|
14925
|
+
import_path5.default.relative(baseDir, lambdaPages[page].fsPath)
|
|
14778
14926
|
);
|
|
14779
14927
|
groupPageFiles[pageFileName] = compressedPages[page];
|
|
14780
14928
|
}
|
|
@@ -14785,8 +14933,8 @@ ${JSON.stringify(
|
|
|
14785
14933
|
"server/pages-manifest.json",
|
|
14786
14934
|
...appPathRoutesManifest ? ["server/app-paths-manifest.json"] : []
|
|
14787
14935
|
]) {
|
|
14788
|
-
const fsPath =
|
|
14789
|
-
const relativePath =
|
|
14936
|
+
const fsPath = import_path5.default.join(entryPath, outputDirectory, manifest);
|
|
14937
|
+
const relativePath = import_path5.default.relative(baseDir, fsPath);
|
|
14790
14938
|
delete group.pseudoLayer[relativePath];
|
|
14791
14939
|
const manifestData = await import_fs_extra5.default.readJSON(fsPath);
|
|
14792
14940
|
const normalizedPages = new Set(
|
|
@@ -14837,7 +14985,7 @@ ${JSON.stringify(
|
|
|
14837
14985
|
let launcherData2 = group.isAppRouter ? appLauncher : launcher;
|
|
14838
14986
|
let preloadChunks = [];
|
|
14839
14987
|
if (process.env.VERCEL_NEXT_PRELOAD_COMMON === "1") {
|
|
14840
|
-
const nextPackageDir =
|
|
14988
|
+
const nextPackageDir = import_path5.default.dirname(
|
|
14841
14989
|
(0, import_resolve_from.default)(projectDir, "next/package.json")
|
|
14842
14990
|
);
|
|
14843
14991
|
if (group.isPages) {
|
|
@@ -14851,8 +14999,8 @@ ${JSON.stringify(
|
|
|
14851
14999
|
}
|
|
14852
15000
|
const normalizedPreloadChunks = [];
|
|
14853
15001
|
for (const preloadChunk of preloadChunks) {
|
|
14854
|
-
const absoluteChunk = preloadChunk.startsWith(".next") ?
|
|
14855
|
-
if (group.pseudoLayer[
|
|
15002
|
+
const absoluteChunk = preloadChunk.startsWith(".next") ? import_path5.default.join(projectDir, preloadChunk) : import_path5.default.join(nextPackageDir, "..", preloadChunk);
|
|
15003
|
+
if (group.pseudoLayer[import_path5.default.join(".", import_path5.default.relative(baseDir, absoluteChunk))]) {
|
|
14856
15004
|
normalizedPreloadChunks.push(
|
|
14857
15005
|
// relative files need to be prefixed with ./ for require
|
|
14858
15006
|
preloadChunk.startsWith(".next") ? `./${preloadChunk}` : preloadChunk
|
|
@@ -14867,7 +15015,7 @@ ${JSON.stringify(
|
|
|
14867
15015
|
}
|
|
14868
15016
|
}
|
|
14869
15017
|
const launcherFiles = {
|
|
14870
|
-
[
|
|
15018
|
+
[import_path5.default.join(import_path5.default.relative(baseDir, projectDir), "___next_launcher.cjs")]: new import_build_utils2.FileBlob({ data: launcherData2 })
|
|
14871
15019
|
};
|
|
14872
15020
|
const operationType = getOperationType({ group, prerenderManifest });
|
|
14873
15021
|
const options = {
|
|
@@ -14876,14 +15024,15 @@ ${JSON.stringify(
|
|
|
14876
15024
|
...updatedManifestFiles
|
|
14877
15025
|
},
|
|
14878
15026
|
layers: [group.pseudoLayer, groupPageFiles],
|
|
14879
|
-
handler:
|
|
14880
|
-
|
|
15027
|
+
handler: import_path5.default.join(
|
|
15028
|
+
import_path5.default.relative(baseDir, projectDir),
|
|
14881
15029
|
"___next_launcher.cjs"
|
|
14882
15030
|
),
|
|
14883
15031
|
operationType,
|
|
14884
15032
|
memory: group.memory,
|
|
14885
15033
|
runtime: nodeVersion.runtime,
|
|
14886
15034
|
maxDuration: group.maxDuration,
|
|
15035
|
+
supportsCancellation: group.supportsCancellation,
|
|
14887
15036
|
isStreaming: group.isStreaming,
|
|
14888
15037
|
nextVersion,
|
|
14889
15038
|
experimentalAllowBundling,
|
|
@@ -14901,11 +15050,11 @@ ${JSON.stringify(
|
|
|
14901
15050
|
if (!isPrerender && routesManifest?.i18n) {
|
|
14902
15051
|
isPrerender = routesManifest.i18n.locales.some((locale) => {
|
|
14903
15052
|
return prerenderRoutes.has(
|
|
14904
|
-
|
|
15053
|
+
import_path5.default.join("/", locale, pageName === "index" ? "" : pageName)
|
|
14905
15054
|
);
|
|
14906
15055
|
});
|
|
14907
15056
|
}
|
|
14908
|
-
let outputName =
|
|
15057
|
+
let outputName = import_path5.default.posix.join(entryDirectory, pageName);
|
|
14909
15058
|
if (group.isActionLambda) {
|
|
14910
15059
|
outputName = `${outputName}.action`;
|
|
14911
15060
|
}
|
|
@@ -14933,7 +15082,7 @@ ${JSON.stringify(
|
|
|
14933
15082
|
continue;
|
|
14934
15083
|
const output = getPostponeResumePathname(routePathname);
|
|
14935
15084
|
lambdas[output] = lambda;
|
|
14936
|
-
outputName =
|
|
15085
|
+
outputName = import_path5.default.posix.join(entryDirectory, routePathname);
|
|
14937
15086
|
experimentalStreamingLambdaPaths.set(outputName, {
|
|
14938
15087
|
pathname: getPostponeResumePathname(routePathname),
|
|
14939
15088
|
output
|
|
@@ -14948,7 +15097,7 @@ ${JSON.stringify(
|
|
|
14948
15097
|
if (i18n && !isPrerender && !group.isAppRouter && (!isCorrectLocaleAPIRoutes || !(pageName === "api" || pageName.startsWith("api/")))) {
|
|
14949
15098
|
for (const locale of i18n.locales) {
|
|
14950
15099
|
lambdas[normalizeIndexOutput(
|
|
14951
|
-
|
|
15100
|
+
import_path5.default.posix.join(
|
|
14952
15101
|
entryDirectory,
|
|
14953
15102
|
locale,
|
|
14954
15103
|
pageName === "index" ? "" : pageName
|
|
@@ -14999,7 +15148,7 @@ ${JSON.stringify(
|
|
|
14999
15148
|
if (appPathRoutesManifest) {
|
|
15000
15149
|
const edgeFunctions = middleware.edgeFunctions;
|
|
15001
15150
|
for (const page of Object.values(appPathRoutesManifest)) {
|
|
15002
|
-
const pathname =
|
|
15151
|
+
const pathname = import_path5.default.posix.join(
|
|
15003
15152
|
"./",
|
|
15004
15153
|
entryDirectory,
|
|
15005
15154
|
page === "/" ? "/index" : page
|
|
@@ -15024,12 +15173,12 @@ ${JSON.stringify(
|
|
|
15024
15173
|
continue;
|
|
15025
15174
|
if (route.sourcePage === route.page)
|
|
15026
15175
|
continue;
|
|
15027
|
-
const sourcePathname =
|
|
15176
|
+
const sourcePathname = import_path5.default.posix.join(
|
|
15028
15177
|
"./",
|
|
15029
15178
|
entryDirectory,
|
|
15030
15179
|
route.sourcePage === "/" ? "/index" : route.sourcePage
|
|
15031
15180
|
);
|
|
15032
|
-
const pathname =
|
|
15181
|
+
const pathname = import_path5.default.posix.join(
|
|
15033
15182
|
"./",
|
|
15034
15183
|
entryDirectory,
|
|
15035
15184
|
route.page === "/" ? "/index" : route.page
|
|
@@ -15067,7 +15216,8 @@ ${JSON.stringify(
|
|
|
15067
15216
|
isEmptyAllowQueryForPrendered,
|
|
15068
15217
|
isAppPPREnabled,
|
|
15069
15218
|
isAppClientSegmentCacheEnabled,
|
|
15070
|
-
isAppClientParamParsingEnabled
|
|
15219
|
+
isAppClientParamParsingEnabled,
|
|
15220
|
+
appPathnameFilesMap: getAppRouterPathnameFilesMap(files)
|
|
15071
15221
|
});
|
|
15072
15222
|
await Promise.all(
|
|
15073
15223
|
Object.keys(prerenderManifest.staticRoutes).map(
|
|
@@ -15106,7 +15256,7 @@ ${JSON.stringify(
|
|
|
15106
15256
|
return;
|
|
15107
15257
|
}
|
|
15108
15258
|
delete lambdas[normalizeIndexOutput(
|
|
15109
|
-
|
|
15259
|
+
import_path5.default.posix.join("./", entryDirectory, route === "/" ? "/index" : route),
|
|
15110
15260
|
true
|
|
15111
15261
|
)];
|
|
15112
15262
|
});
|
|
@@ -15141,7 +15291,7 @@ ${JSON.stringify(
|
|
|
15141
15291
|
);
|
|
15142
15292
|
const pagesPlaceholderRscEntries = {};
|
|
15143
15293
|
if (appDir) {
|
|
15144
|
-
const pagesManifest =
|
|
15294
|
+
const pagesManifest = import_path5.default.join(
|
|
15145
15295
|
entryPath,
|
|
15146
15296
|
outputDirectory,
|
|
15147
15297
|
`server/pages-manifest.json`
|
|
@@ -15165,14 +15315,14 @@ ${JSON.stringify(
|
|
|
15165
15315
|
return isNextDataServerResolving ? [
|
|
15166
15316
|
// strip _next/data prefix for resolving
|
|
15167
15317
|
{
|
|
15168
|
-
src: `^${
|
|
15318
|
+
src: `^${import_path5.default.posix.join(
|
|
15169
15319
|
"/",
|
|
15170
15320
|
entryDirectory,
|
|
15171
15321
|
"/_next/data/",
|
|
15172
15322
|
escapedBuildId,
|
|
15173
15323
|
"/(.*).json"
|
|
15174
15324
|
)}`,
|
|
15175
|
-
dest: `${
|
|
15325
|
+
dest: `${import_path5.default.posix.join(
|
|
15176
15326
|
"/",
|
|
15177
15327
|
entryDirectory,
|
|
15178
15328
|
"/$1",
|
|
@@ -15190,14 +15340,14 @@ ${JSON.stringify(
|
|
|
15190
15340
|
// normalize "/index" from "/_next/data/index.json" to -> just "/"
|
|
15191
15341
|
// as matches a rewrite sources will expect just "/"
|
|
15192
15342
|
{
|
|
15193
|
-
src:
|
|
15343
|
+
src: import_path5.default.posix.join("^/", entryDirectory, "/index(?:/)?"),
|
|
15194
15344
|
has: [
|
|
15195
15345
|
{
|
|
15196
15346
|
type: "header",
|
|
15197
15347
|
key: "x-nextjs-data"
|
|
15198
15348
|
}
|
|
15199
15349
|
],
|
|
15200
|
-
dest:
|
|
15350
|
+
dest: import_path5.default.posix.join(
|
|
15201
15351
|
"/",
|
|
15202
15352
|
entryDirectory,
|
|
15203
15353
|
trailingSlash ? "/" : ""
|
|
@@ -15210,7 +15360,7 @@ ${JSON.stringify(
|
|
|
15210
15360
|
const denormalizeNextDataRoute = (isOverride = false) => {
|
|
15211
15361
|
return isNextDataServerResolving ? [
|
|
15212
15362
|
{
|
|
15213
|
-
src:
|
|
15363
|
+
src: import_path5.default.posix.join(
|
|
15214
15364
|
"^/",
|
|
15215
15365
|
entryDirectory !== "." ? `${entryDirectory}${trailingSlash ? "/$" : "$"}` : "$"
|
|
15216
15366
|
),
|
|
@@ -15220,7 +15370,7 @@ ${JSON.stringify(
|
|
|
15220
15370
|
key: "x-nextjs-data"
|
|
15221
15371
|
}
|
|
15222
15372
|
],
|
|
15223
|
-
dest: `${
|
|
15373
|
+
dest: `${import_path5.default.posix.join(
|
|
15224
15374
|
"/",
|
|
15225
15375
|
entryDirectory,
|
|
15226
15376
|
"/_next/data/",
|
|
@@ -15231,7 +15381,7 @@ ${JSON.stringify(
|
|
|
15231
15381
|
...isOverride ? { override: true } : {}
|
|
15232
15382
|
},
|
|
15233
15383
|
{
|
|
15234
|
-
src:
|
|
15384
|
+
src: import_path5.default.posix.join(
|
|
15235
15385
|
"^/",
|
|
15236
15386
|
entryDirectory,
|
|
15237
15387
|
"((?!_next/)(?:.*[^/]|.*))/?$"
|
|
@@ -15242,7 +15392,7 @@ ${JSON.stringify(
|
|
|
15242
15392
|
key: "x-nextjs-data"
|
|
15243
15393
|
}
|
|
15244
15394
|
],
|
|
15245
|
-
dest: `${
|
|
15395
|
+
dest: `${import_path5.default.posix.join(
|
|
15246
15396
|
"/",
|
|
15247
15397
|
entryDirectory,
|
|
15248
15398
|
"/_next/data/",
|
|
@@ -15256,7 +15406,7 @@ ${JSON.stringify(
|
|
|
15256
15406
|
};
|
|
15257
15407
|
let nextDataCatchallOutput = void 0;
|
|
15258
15408
|
if (isNextDataServerResolving) {
|
|
15259
|
-
const catchallFsPath =
|
|
15409
|
+
const catchallFsPath = import_path5.default.join(
|
|
15260
15410
|
entryPath,
|
|
15261
15411
|
outputDirectory,
|
|
15262
15412
|
"__next_data_catchall.json"
|
|
@@ -15272,7 +15422,7 @@ ${JSON.stringify(
|
|
|
15272
15422
|
const prefetchSegmentSuffix = routesManifest?.rsc?.prefetchSegmentSuffix;
|
|
15273
15423
|
const rscPrefetchHeader = routesManifest.rsc?.prefetchHeader?.toLowerCase();
|
|
15274
15424
|
const rscVaryHeader = routesManifest?.rsc?.varyHeader || "RSC, Next-Router-State-Tree, Next-Router-Prefetch";
|
|
15275
|
-
const appNotFoundPath =
|
|
15425
|
+
const appNotFoundPath = import_path5.default.posix.join(".", entryDirectory, "_not-found");
|
|
15276
15426
|
if (isAppPPREnabled && !rscPrefetchHeader) {
|
|
15277
15427
|
throw new Error("Invariant: cannot use PPR without 'rsc.prefetchHeader'");
|
|
15278
15428
|
}
|
|
@@ -15305,7 +15455,7 @@ ${JSON.stringify(
|
|
|
15305
15455
|
!shouldSkipPrefetchRSCHandling
|
|
15306
15456
|
);
|
|
15307
15457
|
const serverActionMetaRoutes = await getServerActionMetaRoutes(
|
|
15308
|
-
|
|
15458
|
+
import_path5.default.join(entryPath, outputDirectory)
|
|
15309
15459
|
);
|
|
15310
15460
|
return {
|
|
15311
15461
|
wildcard: wildcardConfig,
|
|
@@ -15333,7 +15483,7 @@ ${JSON.stringify(
|
|
|
15333
15483
|
// server to return a plain text "Not Found". However, as we handle the "_next/static/"
|
|
15334
15484
|
// routes in Vercel CLI, the Next.js behavior is overwritten. Therefore, create a
|
|
15335
15485
|
// ".txt" file with "Not Found" content and rewrite any not found static assets to it.
|
|
15336
|
-
[
|
|
15486
|
+
[import_path5.default.posix.join(".", entryDirectory, "_next/static/not-found.txt")]: new import_build_utils2.FileBlob({
|
|
15337
15487
|
data: "Not Found",
|
|
15338
15488
|
contentType: "text/plain"
|
|
15339
15489
|
})
|
|
@@ -15361,31 +15511,31 @@ ${JSON.stringify(
|
|
|
15361
15511
|
// $wildcard
|
|
15362
15512
|
// This is split into two rules to avoid matching the `/index` route as it causes issues with trailing slash redirect
|
|
15363
15513
|
{
|
|
15364
|
-
src: `^${
|
|
15514
|
+
src: `^${import_path5.default.posix.join(
|
|
15365
15515
|
"/",
|
|
15366
15516
|
entryDirectory,
|
|
15367
15517
|
"/"
|
|
15368
15518
|
)}(?!(?:_next/.*|${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(?:/.*|$))$`,
|
|
15369
15519
|
// we aren't able to ensure trailing slash mode here
|
|
15370
15520
|
// so ensure this comes after the trailing slash redirect
|
|
15371
|
-
dest: `${entryDirectory !== "." ?
|
|
15521
|
+
dest: `${entryDirectory !== "." ? import_path5.default.posix.join("/", entryDirectory) : ""}$wildcard${trailingSlash ? "/" : ""}`,
|
|
15372
15522
|
continue: true
|
|
15373
15523
|
},
|
|
15374
15524
|
{
|
|
15375
|
-
src: `^${
|
|
15525
|
+
src: `^${import_path5.default.posix.join(
|
|
15376
15526
|
"/",
|
|
15377
15527
|
entryDirectory,
|
|
15378
15528
|
"/"
|
|
15379
15529
|
)}(?!(?:_next/.*|${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(?:/.*|$))(.*)$`,
|
|
15380
15530
|
// we aren't able to ensure trailing slash mode here
|
|
15381
15531
|
// so ensure this comes after the trailing slash redirect
|
|
15382
|
-
dest: `${entryDirectory !== "." ?
|
|
15532
|
+
dest: `${entryDirectory !== "." ? import_path5.default.posix.join("/", entryDirectory) : ""}$wildcard/$1`,
|
|
15383
15533
|
continue: true
|
|
15384
15534
|
},
|
|
15385
15535
|
// Handle redirecting to locale specific domains
|
|
15386
15536
|
...i18n.domains && i18n.domains.length > 0 && i18n.localeDetection !== false ? [
|
|
15387
15537
|
{
|
|
15388
|
-
src: `^${
|
|
15538
|
+
src: `^${import_path5.default.posix.join(
|
|
15389
15539
|
"/",
|
|
15390
15540
|
entryDirectory
|
|
15391
15541
|
)}/?(?:${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})?/?$`,
|
|
@@ -15433,8 +15583,8 @@ ${JSON.stringify(
|
|
|
15433
15583
|
// and when localeDetection is enabled.
|
|
15434
15584
|
...!skipDefaultLocaleRewrite2 || i18n.localeDetection !== false ? [
|
|
15435
15585
|
{
|
|
15436
|
-
src: `^${
|
|
15437
|
-
dest: `${
|
|
15586
|
+
src: `^${import_path5.default.posix.join("/", entryDirectory)}$`,
|
|
15587
|
+
dest: `${import_path5.default.posix.join(
|
|
15438
15588
|
"/",
|
|
15439
15589
|
entryDirectory,
|
|
15440
15590
|
i18n.defaultLocale
|
|
@@ -15447,12 +15597,12 @@ ${JSON.stringify(
|
|
|
15447
15597
|
// e.g. for /de/posts/[slug] x-now-route-matches would have
|
|
15448
15598
|
// 1=posts%2Fpost-1
|
|
15449
15599
|
{
|
|
15450
|
-
src: `^${
|
|
15600
|
+
src: `^${import_path5.default.posix.join(
|
|
15451
15601
|
"/",
|
|
15452
15602
|
entryDirectory,
|
|
15453
15603
|
"/"
|
|
15454
15604
|
)}(?!(?:_next/.*|${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(?:/.*|$))(.*)$`,
|
|
15455
|
-
dest: `${
|
|
15605
|
+
dest: `${import_path5.default.posix.join(
|
|
15456
15606
|
"/",
|
|
15457
15607
|
entryDirectory,
|
|
15458
15608
|
i18n.defaultLocale
|
|
@@ -15473,7 +15623,7 @@ ${JSON.stringify(
|
|
|
15473
15623
|
// Make sure to 404 for the /404 path itself
|
|
15474
15624
|
...i18n ? [
|
|
15475
15625
|
{
|
|
15476
|
-
src: `${
|
|
15626
|
+
src: `${import_path5.default.posix.join(
|
|
15477
15627
|
"/",
|
|
15478
15628
|
entryDirectory,
|
|
15479
15629
|
"/"
|
|
@@ -15489,7 +15639,7 @@ ${JSON.stringify(
|
|
|
15489
15639
|
}
|
|
15490
15640
|
] : [
|
|
15491
15641
|
{
|
|
15492
|
-
src:
|
|
15642
|
+
src: import_path5.default.posix.join("/", entryDirectory, "404/?"),
|
|
15493
15643
|
status: 404,
|
|
15494
15644
|
continue: true,
|
|
15495
15645
|
missing: [
|
|
@@ -15503,7 +15653,7 @@ ${JSON.stringify(
|
|
|
15503
15653
|
// Make sure to 500 when visiting /500 directly for static 500
|
|
15504
15654
|
...!hasStatic500 ? [] : i18n ? [
|
|
15505
15655
|
{
|
|
15506
|
-
src: `${
|
|
15656
|
+
src: `${import_path5.default.posix.join(
|
|
15507
15657
|
"/",
|
|
15508
15658
|
entryDirectory,
|
|
15509
15659
|
"/"
|
|
@@ -15513,7 +15663,7 @@ ${JSON.stringify(
|
|
|
15513
15663
|
}
|
|
15514
15664
|
] : [
|
|
15515
15665
|
{
|
|
15516
|
-
src:
|
|
15666
|
+
src: import_path5.default.posix.join("/", entryDirectory, "500"),
|
|
15517
15667
|
status: 500,
|
|
15518
15668
|
continue: true
|
|
15519
15669
|
}
|
|
@@ -15527,8 +15677,8 @@ ${JSON.stringify(
|
|
|
15527
15677
|
...appDir ? [
|
|
15528
15678
|
...isAppClientSegmentCacheEnabled && rscPrefetchHeader && prefetchSegmentHeader && prefetchSegmentDirSuffix && prefetchSegmentSuffix ? [
|
|
15529
15679
|
{
|
|
15530
|
-
src:
|
|
15531
|
-
dest:
|
|
15680
|
+
src: import_path5.default.posix.join("/", entryDirectory, "/(?<path>.+)$"),
|
|
15681
|
+
dest: import_path5.default.posix.join(
|
|
15532
15682
|
"/",
|
|
15533
15683
|
entryDirectory,
|
|
15534
15684
|
`/$path${prefetchSegmentDirSuffix}/$segmentPath${prefetchSegmentSuffix}`
|
|
@@ -15554,8 +15704,8 @@ ${JSON.stringify(
|
|
|
15554
15704
|
override: true
|
|
15555
15705
|
},
|
|
15556
15706
|
{
|
|
15557
|
-
src:
|
|
15558
|
-
dest:
|
|
15707
|
+
src: import_path5.default.posix.join("^/", entryDirectory, "$"),
|
|
15708
|
+
dest: import_path5.default.posix.join(
|
|
15559
15709
|
"/",
|
|
15560
15710
|
entryDirectory,
|
|
15561
15711
|
`/index${prefetchSegmentDirSuffix}/$segmentPath${prefetchSegmentSuffix}`
|
|
@@ -15583,7 +15733,7 @@ ${JSON.stringify(
|
|
|
15583
15733
|
] : [],
|
|
15584
15734
|
...rscPrefetchHeader && isAppPPREnabled && !shouldSkipPrefetchRSCHandling ? [
|
|
15585
15735
|
{
|
|
15586
|
-
src: `^${
|
|
15736
|
+
src: `^${import_path5.default.posix.join("/", entryDirectory, "/")}$`,
|
|
15587
15737
|
has: [
|
|
15588
15738
|
{
|
|
15589
15739
|
type: "header",
|
|
@@ -15591,7 +15741,7 @@ ${JSON.stringify(
|
|
|
15591
15741
|
value: "1"
|
|
15592
15742
|
}
|
|
15593
15743
|
],
|
|
15594
|
-
dest:
|
|
15744
|
+
dest: import_path5.default.posix.join(
|
|
15595
15745
|
"/",
|
|
15596
15746
|
entryDirectory,
|
|
15597
15747
|
`/__index${RSC_PREFETCH_SUFFIX}`
|
|
@@ -15601,7 +15751,7 @@ ${JSON.stringify(
|
|
|
15601
15751
|
override: true
|
|
15602
15752
|
},
|
|
15603
15753
|
{
|
|
15604
|
-
src: `^${
|
|
15754
|
+
src: `^${import_path5.default.posix.join(
|
|
15605
15755
|
"/",
|
|
15606
15756
|
entryDirectory,
|
|
15607
15757
|
"/((?!.+\\.rsc).+?)(?:/)?$"
|
|
@@ -15613,7 +15763,7 @@ ${JSON.stringify(
|
|
|
15613
15763
|
value: "1"
|
|
15614
15764
|
}
|
|
15615
15765
|
],
|
|
15616
|
-
dest:
|
|
15766
|
+
dest: import_path5.default.posix.join(
|
|
15617
15767
|
"/",
|
|
15618
15768
|
entryDirectory,
|
|
15619
15769
|
`/$1${RSC_PREFETCH_SUFFIX}`
|
|
@@ -15624,7 +15774,7 @@ ${JSON.stringify(
|
|
|
15624
15774
|
}
|
|
15625
15775
|
] : [],
|
|
15626
15776
|
{
|
|
15627
|
-
src: `^${
|
|
15777
|
+
src: `^${import_path5.default.posix.join("/", entryDirectory, "/?")}`,
|
|
15628
15778
|
has: [
|
|
15629
15779
|
{
|
|
15630
15780
|
type: "header",
|
|
@@ -15632,13 +15782,13 @@ ${JSON.stringify(
|
|
|
15632
15782
|
value: "1"
|
|
15633
15783
|
}
|
|
15634
15784
|
],
|
|
15635
|
-
dest:
|
|
15785
|
+
dest: import_path5.default.posix.join("/", entryDirectory, "/index.rsc"),
|
|
15636
15786
|
headers: { vary: rscVaryHeader },
|
|
15637
15787
|
continue: true,
|
|
15638
15788
|
override: true
|
|
15639
15789
|
},
|
|
15640
15790
|
{
|
|
15641
|
-
src: `^${
|
|
15791
|
+
src: `^${import_path5.default.posix.join(
|
|
15642
15792
|
"/",
|
|
15643
15793
|
entryDirectory,
|
|
15644
15794
|
"/((?!.+\\.rsc).+?)(?:/)?$"
|
|
@@ -15650,7 +15800,7 @@ ${JSON.stringify(
|
|
|
15650
15800
|
value: "1"
|
|
15651
15801
|
}
|
|
15652
15802
|
],
|
|
15653
|
-
dest:
|
|
15803
|
+
dest: import_path5.default.posix.join("/", entryDirectory, "/$1.rsc"),
|
|
15654
15804
|
headers: { vary: rscVaryHeader },
|
|
15655
15805
|
continue: true,
|
|
15656
15806
|
override: true
|
|
@@ -15663,7 +15813,7 @@ ${JSON.stringify(
|
|
|
15663
15813
|
// _next/image path
|
|
15664
15814
|
...routesManifest?.basePath ? [
|
|
15665
15815
|
{
|
|
15666
|
-
src:
|
|
15816
|
+
src: import_path5.default.posix.join("/", entryDirectory, "_next/image/?"),
|
|
15667
15817
|
dest: "/_next/image",
|
|
15668
15818
|
check: true
|
|
15669
15819
|
}
|
|
@@ -15674,8 +15824,8 @@ ${JSON.stringify(
|
|
|
15674
15824
|
// No-op _next/data rewrite to trigger handle: 'rewrites' and then 404
|
|
15675
15825
|
// if no match to prevent rewriting _next/data unexpectedly
|
|
15676
15826
|
{
|
|
15677
|
-
src:
|
|
15678
|
-
dest:
|
|
15827
|
+
src: import_path5.default.posix.join("/", entryDirectory, "_next/data/(.*)"),
|
|
15828
|
+
dest: import_path5.default.posix.join("/", entryDirectory, "_next/data/$1"),
|
|
15679
15829
|
check: true
|
|
15680
15830
|
}
|
|
15681
15831
|
] : [],
|
|
@@ -15683,12 +15833,12 @@ ${JSON.stringify(
|
|
|
15683
15833
|
// as these won't be properly normalized by `afterFilesRewrites` / `dynamicRoutes`
|
|
15684
15834
|
...appPathRoutesManifest ? [
|
|
15685
15835
|
{
|
|
15686
|
-
src:
|
|
15836
|
+
src: import_path5.default.posix.join(
|
|
15687
15837
|
"/",
|
|
15688
15838
|
entryDirectory,
|
|
15689
15839
|
"/index(\\.action|\\.rsc)"
|
|
15690
15840
|
),
|
|
15691
|
-
dest:
|
|
15841
|
+
dest: import_path5.default.posix.join("/", entryDirectory),
|
|
15692
15842
|
continue: true
|
|
15693
15843
|
}
|
|
15694
15844
|
] : [],
|
|
@@ -15699,12 +15849,12 @@ ${JSON.stringify(
|
|
|
15699
15849
|
...appPathRoutesManifest ? [
|
|
15700
15850
|
...shouldSkipPrefetchRSCHandling ? [] : [
|
|
15701
15851
|
{
|
|
15702
|
-
src:
|
|
15852
|
+
src: import_path5.default.posix.join(
|
|
15703
15853
|
"/",
|
|
15704
15854
|
entryDirectory,
|
|
15705
15855
|
"/\\.prefetch\\.rsc$"
|
|
15706
15856
|
),
|
|
15707
|
-
dest:
|
|
15857
|
+
dest: import_path5.default.posix.join(
|
|
15708
15858
|
"/",
|
|
15709
15859
|
entryDirectory,
|
|
15710
15860
|
`/__index${RSC_PREFETCH_SUFFIX}`
|
|
@@ -15712,12 +15862,12 @@ ${JSON.stringify(
|
|
|
15712
15862
|
check: true
|
|
15713
15863
|
},
|
|
15714
15864
|
{
|
|
15715
|
-
src:
|
|
15865
|
+
src: import_path5.default.posix.join(
|
|
15716
15866
|
"/",
|
|
15717
15867
|
entryDirectory,
|
|
15718
15868
|
"(.+)/\\.prefetch\\.rsc$"
|
|
15719
15869
|
),
|
|
15720
|
-
dest:
|
|
15870
|
+
dest: import_path5.default.posix.join(
|
|
15721
15871
|
"/",
|
|
15722
15872
|
entryDirectory,
|
|
15723
15873
|
`$1${RSC_PREFETCH_SUFFIX}`
|
|
@@ -15726,13 +15876,13 @@ ${JSON.stringify(
|
|
|
15726
15876
|
}
|
|
15727
15877
|
],
|
|
15728
15878
|
{
|
|
15729
|
-
src:
|
|
15730
|
-
dest:
|
|
15879
|
+
src: import_path5.default.posix.join("/", entryDirectory, "/\\.rsc$"),
|
|
15880
|
+
dest: import_path5.default.posix.join("/", entryDirectory, `/index.rsc`),
|
|
15731
15881
|
check: true
|
|
15732
15882
|
},
|
|
15733
15883
|
{
|
|
15734
|
-
src:
|
|
15735
|
-
dest:
|
|
15884
|
+
src: import_path5.default.posix.join("/", entryDirectory, "(.+)/\\.rsc$"),
|
|
15885
|
+
dest: import_path5.default.posix.join("/", entryDirectory, "$1.rsc"),
|
|
15736
15886
|
check: true
|
|
15737
15887
|
}
|
|
15738
15888
|
] : [],
|
|
@@ -15740,15 +15890,15 @@ ${JSON.stringify(
|
|
|
15740
15890
|
...fallbackRewrites,
|
|
15741
15891
|
// make sure 404 page is used when a directory is matched without
|
|
15742
15892
|
// an index page
|
|
15743
|
-
{ src:
|
|
15893
|
+
{ src: import_path5.default.posix.join("/", entryDirectory, ".*"), status: 404 },
|
|
15744
15894
|
{ handle: "miss" },
|
|
15745
15895
|
// We need to make sure to 404 for /_next after handle: miss since
|
|
15746
15896
|
// handle: miss is called before rewrites and to prevent rewriting /_next
|
|
15747
15897
|
{
|
|
15748
|
-
src:
|
|
15898
|
+
src: import_path5.default.posix.join("/", entryDirectory, "_next/static/.+"),
|
|
15749
15899
|
status: 404,
|
|
15750
15900
|
check: true,
|
|
15751
|
-
dest:
|
|
15901
|
+
dest: import_path5.default.posix.join(
|
|
15752
15902
|
"/",
|
|
15753
15903
|
entryDirectory,
|
|
15754
15904
|
"_next/static/not-found.txt"
|
|
@@ -15764,8 +15914,8 @@ ${JSON.stringify(
|
|
|
15764
15914
|
// we only want to add the rewrite as the fallback case once routing is complete.
|
|
15765
15915
|
...skipDefaultLocaleRewrite2 && i18n.localeDetection === false ? [
|
|
15766
15916
|
{
|
|
15767
|
-
src: `^${
|
|
15768
|
-
dest: `${
|
|
15917
|
+
src: `^${import_path5.default.posix.join("/", entryDirectory)}$`,
|
|
15918
|
+
dest: `${import_path5.default.posix.join(
|
|
15769
15919
|
"/",
|
|
15770
15920
|
entryDirectory,
|
|
15771
15921
|
i18n.defaultLocale
|
|
@@ -15778,12 +15928,12 @@ ${JSON.stringify(
|
|
|
15778
15928
|
// e.g. for /de/posts/[slug] x-now-route-matches would have
|
|
15779
15929
|
// 1=posts%2Fpost-1
|
|
15780
15930
|
{
|
|
15781
|
-
src: `^${
|
|
15931
|
+
src: `^${import_path5.default.posix.join(
|
|
15782
15932
|
"/",
|
|
15783
15933
|
entryDirectory,
|
|
15784
15934
|
"/"
|
|
15785
15935
|
)}(?!(?:_next/.*|${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(?:/.*|$))(.*)$`,
|
|
15786
|
-
dest: `${
|
|
15936
|
+
dest: `${import_path5.default.posix.join(
|
|
15787
15937
|
"/",
|
|
15788
15938
|
entryDirectory,
|
|
15789
15939
|
i18n.defaultLocale
|
|
@@ -15792,7 +15942,7 @@ ${JSON.stringify(
|
|
|
15792
15942
|
}
|
|
15793
15943
|
] : [],
|
|
15794
15944
|
{
|
|
15795
|
-
src:
|
|
15945
|
+
src: import_path5.default.posix.join(
|
|
15796
15946
|
"/",
|
|
15797
15947
|
entryDirectory,
|
|
15798
15948
|
(0, import_escape_string_regexp2.default)(i18n.defaultLocale)
|
|
@@ -15801,8 +15951,8 @@ ${JSON.stringify(
|
|
|
15801
15951
|
check: true
|
|
15802
15952
|
},
|
|
15803
15953
|
{
|
|
15804
|
-
src: `^${
|
|
15805
|
-
dest: `${
|
|
15954
|
+
src: `^${import_path5.default.posix.join("/", entryDirectory)}/?(?:${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})/(.*)`,
|
|
15955
|
+
dest: `${import_path5.default.posix.join("/", entryDirectory, "/")}$1`,
|
|
15806
15956
|
check: true
|
|
15807
15957
|
}
|
|
15808
15958
|
] : [],
|
|
@@ -15840,7 +15990,7 @@ ${JSON.stringify(
|
|
|
15840
15990
|
"^"
|
|
15841
15991
|
);
|
|
15842
15992
|
}
|
|
15843
|
-
route.src =
|
|
15993
|
+
route.src = import_path5.default.posix.join(
|
|
15844
15994
|
"^/",
|
|
15845
15995
|
entryDirectory,
|
|
15846
15996
|
"_next/data/",
|
|
@@ -15850,14 +16000,14 @@ ${JSON.stringify(
|
|
|
15850
16000
|
const parsedDestination = new URL(route.dest || "/", "http://n");
|
|
15851
16001
|
let pathname = parsedDestination.pathname;
|
|
15852
16002
|
const search = parsedDestination.search;
|
|
15853
|
-
let isPrerender = !!prerenders[
|
|
16003
|
+
let isPrerender = !!prerenders[import_path5.default.join("./", pathname)];
|
|
15854
16004
|
if (routesManifest.i18n) {
|
|
15855
16005
|
for (const locale of routesManifest.i18n?.locales || []) {
|
|
15856
16006
|
const prerenderPathname = pathname.replace(
|
|
15857
16007
|
/\/\$nextLocale/,
|
|
15858
16008
|
`/${locale}`
|
|
15859
16009
|
);
|
|
15860
|
-
if (prerenders[
|
|
16010
|
+
if (prerenders[import_path5.default.join("./", prerenderPathname)]) {
|
|
15861
16011
|
isPrerender = true;
|
|
15862
16012
|
break;
|
|
15863
16013
|
}
|
|
@@ -15881,8 +16031,8 @@ ${JSON.stringify(
|
|
|
15881
16031
|
// ensure we 404 for non-existent _next/data routes before
|
|
15882
16032
|
// trying page dynamic routes
|
|
15883
16033
|
{
|
|
15884
|
-
src:
|
|
15885
|
-
dest:
|
|
16034
|
+
src: import_path5.default.posix.join("/", entryDirectory, "_next/data/(.*)"),
|
|
16035
|
+
dest: import_path5.default.posix.join("/", entryDirectory, "404"),
|
|
15886
16036
|
status: 404
|
|
15887
16037
|
}
|
|
15888
16038
|
] : [],
|
|
@@ -15891,7 +16041,7 @@ ${JSON.stringify(
|
|
|
15891
16041
|
...dynamicRoutes,
|
|
15892
16042
|
...isNextDataServerResolving ? [
|
|
15893
16043
|
{
|
|
15894
|
-
src: `^${
|
|
16044
|
+
src: `^${import_path5.default.posix.join(
|
|
15895
16045
|
"/",
|
|
15896
16046
|
entryDirectory,
|
|
15897
16047
|
"/_next/data/",
|
|
@@ -15907,7 +16057,7 @@ ${JSON.stringify(
|
|
|
15907
16057
|
// add a catch-all data route so we don't 404 when getting
|
|
15908
16058
|
// middleware effects
|
|
15909
16059
|
{
|
|
15910
|
-
src: `^${
|
|
16060
|
+
src: `^${import_path5.default.posix.join(
|
|
15911
16061
|
"/",
|
|
15912
16062
|
entryDirectory,
|
|
15913
16063
|
"/_next/data/",
|
|
@@ -15923,7 +16073,7 @@ ${JSON.stringify(
|
|
|
15923
16073
|
{
|
|
15924
16074
|
// This ensures we only match known emitted-by-Next.js files and not
|
|
15925
16075
|
// user-emitted files which may be missing a hash in their filename.
|
|
15926
|
-
src:
|
|
16076
|
+
src: import_path5.default.posix.join(
|
|
15927
16077
|
"/",
|
|
15928
16078
|
entryDirectory,
|
|
15929
16079
|
`_next/static/(?:[^/]+/pages|pages|chunks|runtime|css|image|media|${escapedBuildId})/.+`
|
|
@@ -15937,7 +16087,7 @@ ${JSON.stringify(
|
|
|
15937
16087
|
important: true
|
|
15938
16088
|
},
|
|
15939
16089
|
{
|
|
15940
|
-
src:
|
|
16090
|
+
src: import_path5.default.posix.join("/", entryDirectory, "/index(?:/)?"),
|
|
15941
16091
|
headers: {
|
|
15942
16092
|
"x-matched-path": "/"
|
|
15943
16093
|
},
|
|
@@ -15945,7 +16095,7 @@ ${JSON.stringify(
|
|
|
15945
16095
|
important: true
|
|
15946
16096
|
},
|
|
15947
16097
|
{
|
|
15948
|
-
src:
|
|
16098
|
+
src: import_path5.default.posix.join("/", entryDirectory, `/((?!index$).*?)(?:/)?`),
|
|
15949
16099
|
headers: {
|
|
15950
16100
|
"x-matched-path": "/$1"
|
|
15951
16101
|
},
|
|
@@ -15957,18 +16107,18 @@ ${JSON.stringify(
|
|
|
15957
16107
|
// Custom Next.js 404 page
|
|
15958
16108
|
...i18n && (static404Page || hasIsr404Page || lambdaPages["404.js"]) ? [
|
|
15959
16109
|
{
|
|
15960
|
-
src: `${
|
|
16110
|
+
src: `${import_path5.default.posix.join(
|
|
15961
16111
|
"/",
|
|
15962
16112
|
entryDirectory,
|
|
15963
16113
|
"/"
|
|
15964
16114
|
)}(?<nextLocale>${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(/.*|$)`,
|
|
15965
|
-
dest:
|
|
16115
|
+
dest: import_path5.default.posix.join("/", entryDirectory, "/$nextLocale/404"),
|
|
15966
16116
|
status: 404,
|
|
15967
16117
|
caseSensitive: true
|
|
15968
16118
|
},
|
|
15969
16119
|
{
|
|
15970
|
-
src:
|
|
15971
|
-
dest:
|
|
16120
|
+
src: import_path5.default.posix.join("/", entryDirectory, ".*"),
|
|
16121
|
+
dest: import_path5.default.posix.join(
|
|
15972
16122
|
"/",
|
|
15973
16123
|
entryDirectory,
|
|
15974
16124
|
`/${i18n.defaultLocale}/404`
|
|
@@ -15977,7 +16127,7 @@ ${JSON.stringify(
|
|
|
15977
16127
|
}
|
|
15978
16128
|
] : [
|
|
15979
16129
|
{
|
|
15980
|
-
src:
|
|
16130
|
+
src: import_path5.default.posix.join(
|
|
15981
16131
|
"/",
|
|
15982
16132
|
entryDirectory,
|
|
15983
16133
|
// if entryDirectory is populated we need to
|
|
@@ -15985,10 +16135,10 @@ ${JSON.stringify(
|
|
|
15985
16135
|
// that the entryDirectory (basePath) itself matches
|
|
15986
16136
|
`${entryDirectory !== "." ? "?" : ""}.*`
|
|
15987
16137
|
),
|
|
15988
|
-
dest:
|
|
16138
|
+
dest: import_path5.default.posix.join(
|
|
15989
16139
|
"/",
|
|
15990
16140
|
entryDirectory,
|
|
15991
|
-
static404Page || hasIsr404Page || lambdas[
|
|
16141
|
+
static404Page || hasIsr404Page || lambdas[import_path5.default.posix.join(entryDirectory, "404")] ? "/404" : appPathRoutesManifest && (middleware.edgeFunctions[appNotFoundPath] || lambdas[appNotFoundPath]) ? "/_not-found" : "/_error"
|
|
15992
16142
|
),
|
|
15993
16143
|
status: 404
|
|
15994
16144
|
}
|
|
@@ -15996,18 +16146,18 @@ ${JSON.stringify(
|
|
|
15996
16146
|
// custom 500 page if present
|
|
15997
16147
|
...i18n && (hasStatic500 || hasIsr500Page || lambdaPages["500.js"]) ? [
|
|
15998
16148
|
{
|
|
15999
|
-
src: `${
|
|
16149
|
+
src: `${import_path5.default.posix.join(
|
|
16000
16150
|
"/",
|
|
16001
16151
|
entryDirectory,
|
|
16002
16152
|
"/"
|
|
16003
16153
|
)}(?<nextLocale>${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(/.*|$)`,
|
|
16004
|
-
dest:
|
|
16154
|
+
dest: import_path5.default.posix.join("/", entryDirectory, "/$nextLocale/500"),
|
|
16005
16155
|
status: 500,
|
|
16006
16156
|
caseSensitive: true
|
|
16007
16157
|
},
|
|
16008
16158
|
{
|
|
16009
|
-
src:
|
|
16010
|
-
dest:
|
|
16159
|
+
src: import_path5.default.posix.join("/", entryDirectory, ".*"),
|
|
16160
|
+
dest: import_path5.default.posix.join(
|
|
16011
16161
|
"/",
|
|
16012
16162
|
entryDirectory,
|
|
16013
16163
|
`/${i18n.defaultLocale}/500`
|
|
@@ -16016,7 +16166,7 @@ ${JSON.stringify(
|
|
|
16016
16166
|
}
|
|
16017
16167
|
] : [
|
|
16018
16168
|
{
|
|
16019
|
-
src:
|
|
16169
|
+
src: import_path5.default.posix.join(
|
|
16020
16170
|
"/",
|
|
16021
16171
|
entryDirectory,
|
|
16022
16172
|
// if entryDirectory is populated we need to
|
|
@@ -16024,10 +16174,10 @@ ${JSON.stringify(
|
|
|
16024
16174
|
// that the entryDirectory (basePath) itself matches
|
|
16025
16175
|
`${entryDirectory !== "." ? "?" : ""}.*`
|
|
16026
16176
|
),
|
|
16027
|
-
dest:
|
|
16177
|
+
dest: import_path5.default.posix.join(
|
|
16028
16178
|
"/",
|
|
16029
16179
|
entryDirectory,
|
|
16030
|
-
hasStatic500 || hasIsr500Page || lambdas[
|
|
16180
|
+
hasStatic500 || hasIsr500Page || lambdas[import_path5.default.posix.join(entryDirectory, "500")] ? "/500" : "/_error"
|
|
16031
16181
|
),
|
|
16032
16182
|
status: 500
|
|
16033
16183
|
}
|
|
@@ -16046,7 +16196,7 @@ var BEFORE_FILES_CONTINUE_NEXT_VERSION = "v10.2.3-canary.1";
|
|
|
16046
16196
|
var REDIRECTS_NO_STATIC_NEXT_VERSION = "v11.0.2-canary.15";
|
|
16047
16197
|
var MAX_AGE_ONE_YEAR = 31536e3;
|
|
16048
16198
|
async function readPackageJson(entryPath) {
|
|
16049
|
-
const packagePath =
|
|
16199
|
+
const packagePath = import_path6.default.join(entryPath, "package.json");
|
|
16050
16200
|
try {
|
|
16051
16201
|
return JSON.parse(await (0, import_fs_extra6.readFile)(packagePath, "utf8"));
|
|
16052
16202
|
} catch (err) {
|
|
@@ -16056,13 +16206,13 @@ async function readPackageJson(entryPath) {
|
|
|
16056
16206
|
}
|
|
16057
16207
|
async function writePackageJson(workPath, packageJson) {
|
|
16058
16208
|
await (0, import_fs_extra6.writeFile)(
|
|
16059
|
-
|
|
16209
|
+
import_path6.default.join(workPath, "package.json"),
|
|
16060
16210
|
JSON.stringify(packageJson, null, 2)
|
|
16061
16211
|
);
|
|
16062
16212
|
}
|
|
16063
16213
|
async function writeNpmRc(workPath, token) {
|
|
16064
16214
|
await (0, import_fs_extra6.writeFile)(
|
|
16065
|
-
|
|
16215
|
+
import_path6.default.join(workPath, ".npmrc"),
|
|
16066
16216
|
`//registry.npmjs.org/:_authToken=${token}`
|
|
16067
16217
|
);
|
|
16068
16218
|
}
|
|
@@ -16115,14 +16265,14 @@ var build = async (buildOptions) => {
|
|
|
16115
16265
|
buildCallback
|
|
16116
16266
|
} = buildOptions;
|
|
16117
16267
|
validateEntrypoint(entrypoint);
|
|
16118
|
-
let entryDirectory =
|
|
16119
|
-
let entryPath =
|
|
16268
|
+
let entryDirectory = import_path6.default.dirname(entrypoint);
|
|
16269
|
+
let entryPath = import_path6.default.join(workPath, entryDirectory);
|
|
16120
16270
|
if (config.rootDirectory) {
|
|
16121
16271
|
repoRootPath = entryPath;
|
|
16122
|
-
entryPath =
|
|
16272
|
+
entryPath = import_path6.default.join(entryPath, config.rootDirectory);
|
|
16123
16273
|
}
|
|
16124
|
-
const outputDirectory =
|
|
16125
|
-
const dotNextStatic =
|
|
16274
|
+
const outputDirectory = import_path6.default.join("./", config.outputDirectory || ".next");
|
|
16275
|
+
const dotNextStatic = import_path6.default.join(entryPath, outputDirectory, "static");
|
|
16126
16276
|
const baseDir = repoRootPath || workPath;
|
|
16127
16277
|
(0, import_build_utils3.debug)(
|
|
16128
16278
|
JSON.stringify(
|
|
@@ -16147,7 +16297,7 @@ var build = async (buildOptions) => {
|
|
|
16147
16297
|
}
|
|
16148
16298
|
await (0, import_build_utils3.download)(files, workPath, meta);
|
|
16149
16299
|
if (config.rootDirectory) {
|
|
16150
|
-
workPath =
|
|
16300
|
+
workPath = import_path6.default.join(workPath, config.rootDirectory);
|
|
16151
16301
|
}
|
|
16152
16302
|
let pkg = await readPackageJson(entryPath);
|
|
16153
16303
|
const nextVersionRange = await getNextVersionRange(entryPath);
|
|
@@ -16183,8 +16333,8 @@ var build = async (buildOptions) => {
|
|
|
16183
16333
|
"WARNING: your application is being deployed in @vercel/next's legacy mode. http://err.sh/vercel/vercel/now-next-legacy-mode"
|
|
16184
16334
|
);
|
|
16185
16335
|
await Promise.all([
|
|
16186
|
-
(0, import_fs_extra6.remove)(
|
|
16187
|
-
(0, import_fs_extra6.remove)(
|
|
16336
|
+
(0, import_fs_extra6.remove)(import_path6.default.join(entryPath, "yarn.lock")),
|
|
16337
|
+
(0, import_fs_extra6.remove)(import_path6.default.join(entryPath, "package-lock.json"))
|
|
16188
16338
|
]);
|
|
16189
16339
|
(0, import_build_utils3.debug)("Normalizing package.json");
|
|
16190
16340
|
pkg = normalizePackageJson(pkg);
|
|
@@ -16295,7 +16445,7 @@ var build = async (buildOptions) => {
|
|
|
16295
16445
|
if (Array.isArray(nowJsonData.routes) && nowJsonData.routes.length > 0) {
|
|
16296
16446
|
hasLegacyRoutes = true;
|
|
16297
16447
|
console.warn(
|
|
16298
|
-
`WARNING: your application is being opted out of @vercel/next's optimized lambdas mode due to legacy routes in ${
|
|
16448
|
+
`WARNING: your application is being opted out of @vercel/next's optimized lambdas mode due to legacy routes in ${import_path6.default.basename(
|
|
16299
16449
|
nowJsonPath
|
|
16300
16450
|
)}. http://err.sh/vercel/vercel/next-legacy-routes-optimized-lambdas`
|
|
16301
16451
|
);
|
|
@@ -16338,8 +16488,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16338
16488
|
start: entryPath,
|
|
16339
16489
|
base: repoRootPath
|
|
16340
16490
|
});
|
|
16341
|
-
const nodeBinPath = nodeBinPaths.join(
|
|
16342
|
-
env.PATH = `${nodeBinPath}${
|
|
16491
|
+
const nodeBinPath = nodeBinPaths.join(import_path6.default.delimiter);
|
|
16492
|
+
env.PATH = `${nodeBinPath}${import_path6.default.delimiter}${env.PATH}`;
|
|
16343
16493
|
if (!env.YARN_NODE_LINKER) {
|
|
16344
16494
|
env.YARN_NODE_LINKER = "node-modules";
|
|
16345
16495
|
}
|
|
@@ -16374,18 +16524,18 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16374
16524
|
let buildOutputVersion;
|
|
16375
16525
|
try {
|
|
16376
16526
|
const data = await (0, import_fs_extra6.readJSON)(
|
|
16377
|
-
|
|
16527
|
+
import_path6.default.join(outputDirectory, "output/config.json")
|
|
16378
16528
|
);
|
|
16379
16529
|
buildOutputVersion = data.version;
|
|
16380
16530
|
} catch (_) {
|
|
16381
16531
|
}
|
|
16382
16532
|
if (buildOutputVersion) {
|
|
16383
16533
|
return {
|
|
16384
|
-
buildOutputPath:
|
|
16534
|
+
buildOutputPath: import_path6.default.join(outputDirectory, "output"),
|
|
16385
16535
|
buildOutputVersion
|
|
16386
16536
|
};
|
|
16387
16537
|
}
|
|
16388
|
-
let appMountPrefixNoTrailingSlash =
|
|
16538
|
+
let appMountPrefixNoTrailingSlash = import_path6.default.posix.join("/", entryDirectory).replace(/\/+$/, "");
|
|
16389
16539
|
const requiredServerFilesManifest = isServerMode ? await getRequiredServerFilesManifest(entryPath, outputDirectory) : false;
|
|
16390
16540
|
isServerMode = Boolean(requiredServerFilesManifest);
|
|
16391
16541
|
const functionsConfigManifest = await getFunctionsConfigManifest(
|
|
@@ -16411,11 +16561,11 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16411
16561
|
);
|
|
16412
16562
|
const hasIsr404Page = typeof prerenderManifest.staticRoutes[routesManifest?.i18n ? (
|
|
16413
16563
|
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
16414
|
-
|
|
16564
|
+
import_path6.default.join("/", routesManifest?.i18n.defaultLocale, "/404")
|
|
16415
16565
|
) : "/404"]?.initialRevalidate === "number";
|
|
16416
16566
|
const hasIsr500Page = typeof prerenderManifest.staticRoutes[routesManifest?.i18n ? (
|
|
16417
16567
|
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
16418
|
-
|
|
16568
|
+
import_path6.default.join("/", routesManifest?.i18n.defaultLocale, "/500")
|
|
16419
16569
|
) : "/500"]?.initialRevalidate === "number";
|
|
16420
16570
|
const wildcardConfig = routesManifest?.i18n?.domains && routesManifest.i18n.domains.length > 0 ? routesManifest.i18n.domains.map((item) => {
|
|
16421
16571
|
return {
|
|
@@ -16424,7 +16574,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16424
16574
|
};
|
|
16425
16575
|
}) : void 0;
|
|
16426
16576
|
const privateOutputs = await getPrivateOutputs(
|
|
16427
|
-
|
|
16577
|
+
import_path6.default.join(entryPath, outputDirectory),
|
|
16428
16578
|
{
|
|
16429
16579
|
"next-stats.json": "_next/__private/stats.json",
|
|
16430
16580
|
trace: "_next/__private/trace"
|
|
@@ -16443,7 +16593,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16443
16593
|
if (isLegacy || isSharedLambdas || isServerMode) {
|
|
16444
16594
|
try {
|
|
16445
16595
|
buildId = await (0, import_fs_extra6.readFile)(
|
|
16446
|
-
|
|
16596
|
+
import_path6.default.join(entryPath, outputDirectory, "BUILD_ID"),
|
|
16447
16597
|
"utf8"
|
|
16448
16598
|
);
|
|
16449
16599
|
escapedBuildId = (0, import_escape_string_regexp3.default)(buildId);
|
|
@@ -16541,8 +16691,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16541
16691
|
link: "https://vercel.com/docs/platform/projects#project-settings"
|
|
16542
16692
|
});
|
|
16543
16693
|
}
|
|
16544
|
-
entryDirectory =
|
|
16545
|
-
appMountPrefixNoTrailingSlash =
|
|
16694
|
+
entryDirectory = import_path6.default.join(entryDirectory, nextBasePath);
|
|
16695
|
+
appMountPrefixNoTrailingSlash = import_path6.default.posix.join("/", entryDirectory).replace(/\/+$/, "");
|
|
16546
16696
|
}
|
|
16547
16697
|
if (routesManifest.pages404) {
|
|
16548
16698
|
hasPages404 = true;
|
|
@@ -16557,7 +16707,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16557
16707
|
}
|
|
16558
16708
|
}
|
|
16559
16709
|
}
|
|
16560
|
-
let dynamicPrefix =
|
|
16710
|
+
let dynamicPrefix = import_path6.default.posix.join("/", entryDirectory);
|
|
16561
16711
|
dynamicPrefix = dynamicPrefix === "/" ? "" : dynamicPrefix;
|
|
16562
16712
|
if (imagesManifest) {
|
|
16563
16713
|
switch (imagesManifest.version) {
|
|
@@ -16672,7 +16822,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16672
16822
|
...beforeFilesRewrites,
|
|
16673
16823
|
// Make sure to 404 for the /404 path itself
|
|
16674
16824
|
{
|
|
16675
|
-
src:
|
|
16825
|
+
src: import_path6.default.posix.join("/", entryDirectory, "404/?"),
|
|
16676
16826
|
status: 404,
|
|
16677
16827
|
continue: true
|
|
16678
16828
|
},
|
|
@@ -16683,7 +16833,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16683
16833
|
// _next/image path
|
|
16684
16834
|
...routesManifest?.basePath ? [
|
|
16685
16835
|
{
|
|
16686
|
-
src:
|
|
16836
|
+
src: import_path6.default.posix.join("/", entryDirectory, "_next/image/?"),
|
|
16687
16837
|
dest: "/_next/image",
|
|
16688
16838
|
check: true
|
|
16689
16839
|
}
|
|
@@ -16691,12 +16841,12 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16691
16841
|
// No-op _next/data rewrite to trigger handle: 'rewrites' and then 404
|
|
16692
16842
|
// if no match to prevent rewriting _next/data unexpectedly
|
|
16693
16843
|
{
|
|
16694
|
-
src:
|
|
16695
|
-
dest:
|
|
16844
|
+
src: import_path6.default.posix.join("/", entryDirectory, "_next/data/(.*)"),
|
|
16845
|
+
dest: import_path6.default.posix.join("/", entryDirectory, "_next/data/$1"),
|
|
16696
16846
|
check: true
|
|
16697
16847
|
},
|
|
16698
16848
|
{
|
|
16699
|
-
src:
|
|
16849
|
+
src: import_path6.default.posix.join("/", entryDirectory, "_next/data/(.*)"),
|
|
16700
16850
|
status: 404
|
|
16701
16851
|
},
|
|
16702
16852
|
// These need to come before handle: miss or else they are grouped
|
|
@@ -16706,16 +16856,16 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16706
16856
|
// an index page
|
|
16707
16857
|
{ handle: "resource" },
|
|
16708
16858
|
...fallbackRewrites,
|
|
16709
|
-
{ src:
|
|
16859
|
+
{ src: import_path6.default.posix.join("/", entryDirectory, ".*"), status: 404 },
|
|
16710
16860
|
// We need to make sure to 404 for /_next after handle: miss since
|
|
16711
16861
|
// handle: miss is called before rewrites and to prevent rewriting
|
|
16712
16862
|
// /_next
|
|
16713
16863
|
{ handle: "miss" },
|
|
16714
16864
|
{
|
|
16715
|
-
src:
|
|
16865
|
+
src: import_path6.default.posix.join("/", entryDirectory, "_next/static/.+"),
|
|
16716
16866
|
status: 404,
|
|
16717
16867
|
check: true,
|
|
16718
|
-
dest:
|
|
16868
|
+
dest: import_path6.default.posix.join(
|
|
16719
16869
|
"/",
|
|
16720
16870
|
entryDirectory,
|
|
16721
16871
|
"_next/static/not-found.txt"
|
|
@@ -16733,7 +16883,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16733
16883
|
{
|
|
16734
16884
|
// This ensures we only match known emitted-by-Next.js files and not
|
|
16735
16885
|
// user-emitted files which may be missing a hash in their filename.
|
|
16736
|
-
src:
|
|
16886
|
+
src: import_path6.default.posix.join(
|
|
16737
16887
|
"/",
|
|
16738
16888
|
entryDirectory,
|
|
16739
16889
|
`_next/static/(?:[^/]+/pages|pages|chunks|runtime|css|image|media|${escapedBuildId})/.+`
|
|
@@ -16747,12 +16897,12 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16747
16897
|
important: true
|
|
16748
16898
|
},
|
|
16749
16899
|
// error handling
|
|
16750
|
-
...output[
|
|
16900
|
+
...output[import_path6.default.posix.join("./", entryDirectory, "404")] || output[import_path6.default.posix.join("./", entryDirectory, "404/index")] ? [
|
|
16751
16901
|
{ handle: "error" },
|
|
16752
16902
|
{
|
|
16753
16903
|
status: 404,
|
|
16754
|
-
src:
|
|
16755
|
-
dest:
|
|
16904
|
+
src: import_path6.default.posix.join(entryDirectory, ".*"),
|
|
16905
|
+
dest: import_path6.default.posix.join("/", entryDirectory, "404")
|
|
16756
16906
|
}
|
|
16757
16907
|
] : []
|
|
16758
16908
|
],
|
|
@@ -16771,7 +16921,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16771
16921
|
);
|
|
16772
16922
|
}
|
|
16773
16923
|
if (process.env.NPM_AUTH_TOKEN) {
|
|
16774
|
-
await (0, import_fs_extra6.remove)(
|
|
16924
|
+
await (0, import_fs_extra6.remove)(import_path6.default.join(entryPath, ".npmrc"));
|
|
16775
16925
|
}
|
|
16776
16926
|
const trailingSlashRedirects = [];
|
|
16777
16927
|
let trailingSlash = false;
|
|
@@ -16819,7 +16969,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16819
16969
|
if (filesAfterBuild["next.config.js"]) {
|
|
16820
16970
|
nextFiles["next.config.js"] = filesAfterBuild["next.config.js"];
|
|
16821
16971
|
}
|
|
16822
|
-
const pagesDir =
|
|
16972
|
+
const pagesDir = import_path6.default.join(
|
|
16823
16973
|
entryPath,
|
|
16824
16974
|
outputDirectory,
|
|
16825
16975
|
"server",
|
|
@@ -16832,7 +16982,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16832
16982
|
entryPath,
|
|
16833
16983
|
outputDirectory
|
|
16834
16984
|
});
|
|
16835
|
-
const launcherPath =
|
|
16985
|
+
const launcherPath = import_path6.default.join(__dirname, "legacy-launcher.js");
|
|
16836
16986
|
const launcherData = await (0, import_fs_extra6.readFile)(launcherPath, "utf8");
|
|
16837
16987
|
await Promise.all(
|
|
16838
16988
|
Object.keys(pages).map(async (page) => {
|
|
@@ -16861,7 +17011,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16861
17011
|
});
|
|
16862
17012
|
}
|
|
16863
17013
|
(0, import_build_utils3.debug)(`Creating serverless function for page: "${page}"...`);
|
|
16864
|
-
lambdas[
|
|
17014
|
+
lambdas[import_path6.default.posix.join(entryDirectory, pathname)] = new import_build_utils3.NodejsLambda({
|
|
16865
17015
|
files: {
|
|
16866
17016
|
...nextFiles,
|
|
16867
17017
|
...pageFiles,
|
|
@@ -16885,7 +17035,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16885
17035
|
);
|
|
16886
17036
|
} else {
|
|
16887
17037
|
(0, import_build_utils3.debug)("Preparing serverless function files...");
|
|
16888
|
-
const pagesDir =
|
|
17038
|
+
const pagesDir = import_path6.default.join(
|
|
16889
17039
|
entryPath,
|
|
16890
17040
|
outputDirectory,
|
|
16891
17041
|
isServerMode ? "server" : "serverless",
|
|
@@ -16893,10 +17043,10 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16893
17043
|
);
|
|
16894
17044
|
let appDir = null;
|
|
16895
17045
|
const appPathRoutesManifest = await (0, import_fs_extra6.readJSON)(
|
|
16896
|
-
|
|
17046
|
+
import_path6.default.join(entryPath, outputDirectory, "app-path-routes-manifest.json")
|
|
16897
17047
|
).catch(() => null);
|
|
16898
17048
|
if (appPathRoutesManifest) {
|
|
16899
|
-
appDir =
|
|
17049
|
+
appDir = import_path6.default.join(pagesDir, "../app");
|
|
16900
17050
|
}
|
|
16901
17051
|
const { pages, appPaths: lambdaAppPaths } = await getServerlessPages({
|
|
16902
17052
|
pagesDir,
|
|
@@ -16916,14 +17066,14 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16916
17066
|
prerenderManifest,
|
|
16917
17067
|
routesManifest
|
|
16918
17068
|
);
|
|
16919
|
-
hasStatic500 = !!staticPages[
|
|
16920
|
-
static404Page = staticPages[
|
|
17069
|
+
hasStatic500 = !!staticPages[import_path6.default.posix.join(entryDirectory, "500")];
|
|
17070
|
+
static404Page = staticPages[import_path6.default.posix.join(entryDirectory, "404")] && hasPages404 ? import_path6.default.posix.join(entryDirectory, "404") : staticPages[import_path6.default.posix.join(entryDirectory, "_errors/404")] ? import_path6.default.posix.join(entryDirectory, "_errors/404") : void 0;
|
|
16921
17071
|
const { i18n: i18n2 } = routesManifest || {};
|
|
16922
17072
|
if (!static404Page && i18n2) {
|
|
16923
|
-
static404Page = staticPages[
|
|
17073
|
+
static404Page = staticPages[import_path6.default.posix.join(entryDirectory, i18n2.defaultLocale, "404")] ? import_path6.default.posix.join(entryDirectory, i18n2.defaultLocale, "404") : void 0;
|
|
16924
17074
|
}
|
|
16925
17075
|
if (!hasStatic500 && i18n2) {
|
|
16926
|
-
hasStatic500 = !!staticPages[
|
|
17076
|
+
hasStatic500 = !!staticPages[import_path6.default.posix.join(entryDirectory, i18n2.defaultLocale, "500")];
|
|
16927
17077
|
}
|
|
16928
17078
|
if (routesManifest) {
|
|
16929
17079
|
switch (routesManifest.version) {
|
|
@@ -16940,7 +17090,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
16940
17090
|
}
|
|
16941
17091
|
const route = {
|
|
16942
17092
|
src: (dataRoute.namedDataRouteRegex || dataRoute.dataRouteRegex).replace(/^\^/, `^${appMountPrefixNoTrailingSlash}`),
|
|
16943
|
-
dest:
|
|
17093
|
+
dest: import_path6.default.posix.join(
|
|
16944
17094
|
"/",
|
|
16945
17095
|
entryDirectory,
|
|
16946
17096
|
// make sure to route SSG data route to the data prerender
|
|
@@ -17032,7 +17182,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17032
17182
|
`A routes-manifest could not be located, please check your outputDirectory and try again.`
|
|
17033
17183
|
);
|
|
17034
17184
|
}
|
|
17035
|
-
const localePrefixed404 = !!(routesManifest.i18n && originalStaticPages[
|
|
17185
|
+
const localePrefixed404 = !!(routesManifest.i18n && originalStaticPages[import_path6.default.posix.join(".", routesManifest.i18n.defaultLocale, "404.html")]);
|
|
17036
17186
|
return serverBuild({
|
|
17037
17187
|
config,
|
|
17038
17188
|
functionsConfigManifest,
|
|
@@ -17078,7 +17228,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17078
17228
|
isAppFullPPREnabled,
|
|
17079
17229
|
isAppClientSegmentCacheEnabled,
|
|
17080
17230
|
isAppClientParamParsingEnabled,
|
|
17081
|
-
clientParamParsingOrigins
|
|
17231
|
+
clientParamParsingOrigins,
|
|
17232
|
+
files
|
|
17082
17233
|
});
|
|
17083
17234
|
}
|
|
17084
17235
|
const pageKeys = Object.keys(pages);
|
|
@@ -17170,7 +17321,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17170
17321
|
);
|
|
17171
17322
|
for (const page of mergedPageKeys) {
|
|
17172
17323
|
const fileList = parentFilesMap.get(
|
|
17173
|
-
|
|
17324
|
+
import_path6.default.relative(baseDir, pages[page].fsPath)
|
|
17174
17325
|
);
|
|
17175
17326
|
if (!fileList) {
|
|
17176
17327
|
throw new Error(
|
|
@@ -17206,7 +17357,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17206
17357
|
} else {
|
|
17207
17358
|
assets = await (0, import_build_utils3.glob)(
|
|
17208
17359
|
"assets/**",
|
|
17209
|
-
|
|
17360
|
+
import_path6.default.join(entryPath, outputDirectory, "serverless")
|
|
17210
17361
|
);
|
|
17211
17362
|
const assetKeys = Object.keys(assets);
|
|
17212
17363
|
if (assetKeys.length > 0) {
|
|
@@ -17219,7 +17370,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17219
17370
|
);
|
|
17220
17371
|
}
|
|
17221
17372
|
}
|
|
17222
|
-
const launcherPath =
|
|
17373
|
+
const launcherPath = import_path6.default.join(__dirname, "templated-launcher.js");
|
|
17223
17374
|
const launcherData = await (0, import_fs_extra6.readFile)(launcherPath, "utf8");
|
|
17224
17375
|
const allLambdasLabel = `All serverless functions created in`;
|
|
17225
17376
|
if (hasLambdas) {
|
|
@@ -17298,8 +17449,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17298
17449
|
if (page === "_error.js" && (static404Page && staticPages[static404Page] || hasPages404 && pages["404.js"])) {
|
|
17299
17450
|
continue;
|
|
17300
17451
|
}
|
|
17301
|
-
const pageFileName =
|
|
17302
|
-
|
|
17452
|
+
const pageFileName = import_path6.default.normalize(
|
|
17453
|
+
import_path6.default.relative(workPath, pages[page].fsPath)
|
|
17303
17454
|
);
|
|
17304
17455
|
const pathname = page.replace(/\.js$/, "");
|
|
17305
17456
|
const routeIsDynamic = isDynamicRoute(pathname);
|
|
@@ -17310,7 +17461,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17310
17461
|
if (nonLambdaSsgPages.has(`/${pathname}`)) {
|
|
17311
17462
|
continue;
|
|
17312
17463
|
}
|
|
17313
|
-
const outputName =
|
|
17464
|
+
const outputName = import_path6.default.join("/", entryDirectory, pathname);
|
|
17314
17465
|
const lambdaGroupIndex = routeIsApi ? apiLambdaGroupIndex : nonApiLambdaGroupIndex;
|
|
17315
17466
|
const lambdaGroups = routeIsApi ? apiLambdaGroups : pageLambdaGroups;
|
|
17316
17467
|
const lastLambdaGroup = lambdaGroups[lambdaGroupIndex];
|
|
@@ -17321,7 +17472,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17321
17472
|
isApiLambda: !!routeIsApi,
|
|
17322
17473
|
pseudoLayer: group.pseudoLayer,
|
|
17323
17474
|
lambdaCombinedBytes: group.pseudoLayerBytes,
|
|
17324
|
-
lambdaIdentifier:
|
|
17475
|
+
lambdaIdentifier: import_path6.default.join(
|
|
17325
17476
|
entryDirectory,
|
|
17326
17477
|
`__NEXT_${routeIsApi ? "API" : "PAGE"}_LAMBDA_${lambdaGroupIndex}`
|
|
17327
17478
|
)
|
|
@@ -17333,7 +17484,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17333
17484
|
/\/index$/,
|
|
17334
17485
|
"(/|/index|)"
|
|
17335
17486
|
)}/?$`,
|
|
17336
|
-
dest: `${
|
|
17487
|
+
dest: `${import_path6.default.join("/", currentLambdaGroup.lambdaIdentifier)}`,
|
|
17337
17488
|
headers: {
|
|
17338
17489
|
"x-nextjs-page": outputName
|
|
17339
17490
|
},
|
|
@@ -17355,13 +17506,13 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17355
17506
|
addPageLambdaRoute((0, import_escape_string_regexp3.default)(outputName));
|
|
17356
17507
|
}
|
|
17357
17508
|
if (page === "_error.js" || hasPages404 && page === "404.js") {
|
|
17358
|
-
page404Path =
|
|
17509
|
+
page404Path = import_path6.default.join("/", entryDirectory, pathname);
|
|
17359
17510
|
}
|
|
17360
17511
|
currentLambdaGroup.pages[outputName] = {
|
|
17361
17512
|
pageFileName,
|
|
17362
17513
|
pageName: page
|
|
17363
17514
|
};
|
|
17364
|
-
currentLambdaGroup.pseudoLayer[
|
|
17515
|
+
currentLambdaGroup.pseudoLayer[import_path6.default.join(import_path6.default.relative(baseDir, entryPath), pageFileName)] = compressedPages[page];
|
|
17365
17516
|
lambdaGroups[lambdaGroupIndex] = currentLambdaGroup;
|
|
17366
17517
|
}
|
|
17367
17518
|
if (routeIsApi) {
|
|
@@ -17383,16 +17534,16 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17383
17534
|
if (isDynamicRoute(pathname)) {
|
|
17384
17535
|
dynamicPages.push(normalizePage(pathname));
|
|
17385
17536
|
}
|
|
17386
|
-
const pageFileName =
|
|
17387
|
-
|
|
17537
|
+
const pageFileName = import_path6.default.normalize(
|
|
17538
|
+
import_path6.default.relative(entryPath, pages[page].fsPath)
|
|
17388
17539
|
);
|
|
17389
17540
|
const launcher = launcherData.replace(
|
|
17390
17541
|
/__LAUNCHER_PAGE_PATH__/g,
|
|
17391
17542
|
JSON.stringify(requiresTracing ? `./${pageFileName}` : "./page")
|
|
17392
17543
|
);
|
|
17393
17544
|
const launcherFiles = {
|
|
17394
|
-
[
|
|
17395
|
-
|
|
17545
|
+
[import_path6.default.join(
|
|
17546
|
+
import_path6.default.relative(baseDir, entryPath),
|
|
17396
17547
|
"___next_launcher.cjs"
|
|
17397
17548
|
)]: new import_build_utils3.FileBlob({ data: launcher })
|
|
17398
17549
|
};
|
|
@@ -17407,7 +17558,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17407
17558
|
});
|
|
17408
17559
|
}
|
|
17409
17560
|
const outputName = normalizeIndexOutput(
|
|
17410
|
-
|
|
17561
|
+
import_path6.default.join(entryDirectory, pathname),
|
|
17411
17562
|
isServerMode
|
|
17412
17563
|
);
|
|
17413
17564
|
if (requiresTracing) {
|
|
@@ -17419,11 +17570,11 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17419
17570
|
return prev;
|
|
17420
17571
|
}, {}),
|
|
17421
17572
|
{
|
|
17422
|
-
[
|
|
17573
|
+
[import_path6.default.join(import_path6.default.relative(baseDir, entryPath), pageFileName)]: compressedPages[page]
|
|
17423
17574
|
}
|
|
17424
17575
|
],
|
|
17425
|
-
handler:
|
|
17426
|
-
|
|
17576
|
+
handler: import_path6.default.join(
|
|
17577
|
+
import_path6.default.relative(baseDir, entryPath),
|
|
17427
17578
|
"___next_launcher.cjs"
|
|
17428
17579
|
),
|
|
17429
17580
|
operationType: getOperationType({
|
|
@@ -17442,11 +17593,11 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17442
17593
|
},
|
|
17443
17594
|
layers: [
|
|
17444
17595
|
{
|
|
17445
|
-
[
|
|
17596
|
+
[import_path6.default.join(import_path6.default.relative(baseDir, entryPath), "page.js")]: compressedPages[page]
|
|
17446
17597
|
}
|
|
17447
17598
|
],
|
|
17448
|
-
handler:
|
|
17449
|
-
|
|
17599
|
+
handler: import_path6.default.join(
|
|
17600
|
+
import_path6.default.relative(baseDir, entryPath),
|
|
17450
17601
|
"___next_launcher.cjs"
|
|
17451
17602
|
),
|
|
17452
17603
|
operationType: getOperationType({ pageFileName }),
|
|
@@ -17486,7 +17637,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17486
17637
|
)
|
|
17487
17638
|
);
|
|
17488
17639
|
if (isSharedLambdas) {
|
|
17489
|
-
const launcherPath2 =
|
|
17640
|
+
const launcherPath2 = import_path6.default.join(__dirname, "templated-launcher-shared.js");
|
|
17490
17641
|
const launcherData2 = await (0, import_fs_extra6.readFile)(launcherPath2, "utf8");
|
|
17491
17642
|
const completeDynamicRoutes = await getDynamicRoutes({
|
|
17492
17643
|
entryPath,
|
|
@@ -17541,7 +17692,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17541
17692
|
try {
|
|
17542
17693
|
const pages = {
|
|
17543
17694
|
${groupPageKeys.map(
|
|
17544
|
-
(page) => `'${page}': () => require('./${
|
|
17695
|
+
(page) => `'${page}': () => require('./${import_path6.default.join(
|
|
17545
17696
|
"./",
|
|
17546
17697
|
group.pages[page].pageFileName
|
|
17547
17698
|
)}')`
|
|
@@ -17631,8 +17782,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17631
17782
|
`
|
|
17632
17783
|
);
|
|
17633
17784
|
const launcherFiles = {
|
|
17634
|
-
[
|
|
17635
|
-
|
|
17785
|
+
[import_path6.default.join(
|
|
17786
|
+
import_path6.default.relative(baseDir, entryPath),
|
|
17636
17787
|
"___next_launcher.cjs"
|
|
17637
17788
|
)]: new import_build_utils3.FileBlob({ data: launcher })
|
|
17638
17789
|
};
|
|
@@ -17649,8 +17800,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17649
17800
|
...assets
|
|
17650
17801
|
},
|
|
17651
17802
|
layers: [group.pseudoLayer],
|
|
17652
|
-
handler:
|
|
17653
|
-
|
|
17803
|
+
handler: import_path6.default.join(
|
|
17804
|
+
import_path6.default.relative(baseDir, entryPath),
|
|
17654
17805
|
"___next_launcher.cjs"
|
|
17655
17806
|
),
|
|
17656
17807
|
operationType,
|
|
@@ -17683,7 +17834,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17683
17834
|
// The following flags are not supported in this version of the builder.
|
|
17684
17835
|
isAppPPREnabled: false,
|
|
17685
17836
|
isAppClientSegmentCacheEnabled: false,
|
|
17686
|
-
isAppClientParamParsingEnabled: false
|
|
17837
|
+
isAppClientParamParsingEnabled: false,
|
|
17838
|
+
appPathnameFilesMap: getAppRouterPathnameFilesMap(files)
|
|
17687
17839
|
});
|
|
17688
17840
|
await Promise.all(
|
|
17689
17841
|
Object.keys(prerenderManifest.staticRoutes).map(
|
|
@@ -17730,7 +17882,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17730
17882
|
`^${appMountPrefixNoTrailingSlash}`
|
|
17731
17883
|
),
|
|
17732
17884
|
// Location of lambda in builder output
|
|
17733
|
-
dest:
|
|
17885
|
+
dest: import_path6.default.posix.join(entryDirectory, dataRoute),
|
|
17734
17886
|
check: true
|
|
17735
17887
|
});
|
|
17736
17888
|
if (!prefetchDataRoute || !prefetchDataRouteRegex)
|
|
@@ -17740,7 +17892,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17740
17892
|
/^\^/,
|
|
17741
17893
|
`^${appMountPrefixNoTrailingSlash}`
|
|
17742
17894
|
),
|
|
17743
|
-
dest:
|
|
17895
|
+
dest: import_path6.default.posix.join(entryDirectory, prefetchDataRoute),
|
|
17744
17896
|
check: true
|
|
17745
17897
|
});
|
|
17746
17898
|
}
|
|
@@ -17749,7 +17901,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17749
17901
|
}
|
|
17750
17902
|
if (!isSharedLambdas) {
|
|
17751
17903
|
omittedPrerenderRoutes.forEach((routeKey) => {
|
|
17752
|
-
const routeFileNoExt =
|
|
17904
|
+
const routeFileNoExt = import_path6.default.posix.join(
|
|
17753
17905
|
entryDirectory,
|
|
17754
17906
|
routeKey === "/" ? "/index" : routeKey
|
|
17755
17907
|
);
|
|
@@ -17820,31 +17972,31 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17820
17972
|
// $wildcard
|
|
17821
17973
|
// This is split into two rules to avoid matching the `/index` route as it causes issues with trailing slash redirect
|
|
17822
17974
|
{
|
|
17823
|
-
src: `^${
|
|
17975
|
+
src: `^${import_path6.default.posix.join(
|
|
17824
17976
|
"/",
|
|
17825
17977
|
entryDirectory,
|
|
17826
17978
|
"/"
|
|
17827
17979
|
)}(?!(?:_next/.*|${i18n.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})(?:/.*|$))$`,
|
|
17828
17980
|
// we aren't able to ensure trailing slash mode here
|
|
17829
17981
|
// so ensure this comes after the trailing slash redirect
|
|
17830
|
-
dest: `${entryDirectory !== "." ?
|
|
17982
|
+
dest: `${entryDirectory !== "." ? import_path6.default.posix.join("/", entryDirectory) : ""}$wildcard${trailingSlash ? "/" : ""}`,
|
|
17831
17983
|
continue: true
|
|
17832
17984
|
},
|
|
17833
17985
|
{
|
|
17834
|
-
src: `^${
|
|
17986
|
+
src: `^${import_path6.default.join(
|
|
17835
17987
|
"/",
|
|
17836
17988
|
entryDirectory,
|
|
17837
17989
|
"/"
|
|
17838
17990
|
)}(?!(?:_next/.*|${i18n.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})(?:/.*|$))(.*)$`,
|
|
17839
17991
|
// we aren't able to ensure trailing slash mode here
|
|
17840
17992
|
// so ensure this comes after the trailing slash redirect
|
|
17841
|
-
dest: `${entryDirectory !== "." ?
|
|
17993
|
+
dest: `${entryDirectory !== "." ? import_path6.default.join("/", entryDirectory) : ""}$wildcard/$1`,
|
|
17842
17994
|
continue: true
|
|
17843
17995
|
},
|
|
17844
17996
|
// Handle redirecting to locale specific domains
|
|
17845
17997
|
...i18n.domains && i18n.domains.length > 0 && i18n.localeDetection !== false ? [
|
|
17846
17998
|
{
|
|
17847
|
-
src: `^${
|
|
17999
|
+
src: `^${import_path6.default.join("/", entryDirectory)}/?(?:${i18n.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})?/?$`,
|
|
17848
18000
|
locale: {
|
|
17849
18001
|
redirect: i18n.domains.reduce(
|
|
17850
18002
|
(prev, item) => {
|
|
@@ -17885,8 +18037,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17885
18037
|
}
|
|
17886
18038
|
] : [],
|
|
17887
18039
|
{
|
|
17888
|
-
src: `^${
|
|
17889
|
-
dest: `${
|
|
18040
|
+
src: `^${import_path6.default.join("/", entryDirectory)}$`,
|
|
18041
|
+
dest: `${import_path6.default.join("/", entryDirectory, i18n.defaultLocale)}`,
|
|
17890
18042
|
continue: true
|
|
17891
18043
|
},
|
|
17892
18044
|
// Auto-prefix non-locale path with default locale
|
|
@@ -17895,12 +18047,12 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17895
18047
|
// e.g. for /de/posts/[slug] x-now-route-matches would have
|
|
17896
18048
|
// 1=posts%2Fpost-1
|
|
17897
18049
|
{
|
|
17898
|
-
src: `^${
|
|
18050
|
+
src: `^${import_path6.default.join(
|
|
17899
18051
|
"/",
|
|
17900
18052
|
entryDirectory,
|
|
17901
18053
|
"/"
|
|
17902
18054
|
)}(?!(?:_next/.*|${i18n.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})(?:/.*|$))(.*)$`,
|
|
17903
|
-
dest: `${
|
|
18055
|
+
dest: `${import_path6.default.join("/", entryDirectory, i18n.defaultLocale)}/$1`,
|
|
17904
18056
|
continue: true
|
|
17905
18057
|
}
|
|
17906
18058
|
] : [],
|
|
@@ -17910,13 +18062,13 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17910
18062
|
// Make sure to 404 for the /404 path itself
|
|
17911
18063
|
...i18n ? [
|
|
17912
18064
|
{
|
|
17913
|
-
src: `${
|
|
18065
|
+
src: `${import_path6.default.join("/", entryDirectory, "/")}(?:${i18n.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})?[/]?404/?`,
|
|
17914
18066
|
status: 404,
|
|
17915
18067
|
continue: true
|
|
17916
18068
|
}
|
|
17917
18069
|
] : [
|
|
17918
18070
|
{
|
|
17919
|
-
src:
|
|
18071
|
+
src: import_path6.default.join("/", entryDirectory, "404/?"),
|
|
17920
18072
|
status: 404,
|
|
17921
18073
|
continue: true
|
|
17922
18074
|
}
|
|
@@ -17924,13 +18076,13 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17924
18076
|
// Make sure to 500 when visiting /500 directly for static 500
|
|
17925
18077
|
...!hasStatic500 ? [] : i18n ? [
|
|
17926
18078
|
{
|
|
17927
|
-
src: `${
|
|
18079
|
+
src: `${import_path6.default.join("/", entryDirectory, "/")}(?:${i18n.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})?[/]?500`,
|
|
17928
18080
|
status: 500,
|
|
17929
18081
|
continue: true
|
|
17930
18082
|
}
|
|
17931
18083
|
] : [
|
|
17932
18084
|
{
|
|
17933
|
-
src:
|
|
18085
|
+
src: import_path6.default.join("/", entryDirectory, "500"),
|
|
17934
18086
|
status: 500,
|
|
17935
18087
|
continue: true
|
|
17936
18088
|
}
|
|
@@ -17953,7 +18105,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17953
18105
|
// _next/image path
|
|
17954
18106
|
...routesManifest?.basePath ? [
|
|
17955
18107
|
{
|
|
17956
|
-
src:
|
|
18108
|
+
src: import_path6.default.join("/", entryDirectory, "_next/image/?"),
|
|
17957
18109
|
dest: "/_next/image",
|
|
17958
18110
|
check: true
|
|
17959
18111
|
}
|
|
@@ -17961,8 +18113,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17961
18113
|
// No-op _next/data rewrite to trigger handle: 'rewrites' and then 404
|
|
17962
18114
|
// if no match to prevent rewriting _next/data unexpectedly
|
|
17963
18115
|
{
|
|
17964
|
-
src:
|
|
17965
|
-
dest:
|
|
18116
|
+
src: import_path6.default.join("/", entryDirectory, "_next/data/(.*)"),
|
|
18117
|
+
dest: import_path6.default.join("/", entryDirectory, "_next/data/$1"),
|
|
17966
18118
|
check: true
|
|
17967
18119
|
},
|
|
17968
18120
|
// These need to come before handle: miss or else they are grouped
|
|
@@ -17972,15 +18124,15 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17972
18124
|
// an index page
|
|
17973
18125
|
{ handle: "resource" },
|
|
17974
18126
|
...fallbackRewrites,
|
|
17975
|
-
{ src:
|
|
18127
|
+
{ src: import_path6.default.join("/", entryDirectory, ".*"), status: 404 },
|
|
17976
18128
|
// We need to make sure to 404 for /_next after handle: miss since
|
|
17977
18129
|
// handle: miss is called before rewrites and to prevent rewriting /_next
|
|
17978
18130
|
{ handle: "miss" },
|
|
17979
18131
|
{
|
|
17980
|
-
src:
|
|
18132
|
+
src: import_path6.default.join("/", entryDirectory, "_next/static/.+"),
|
|
17981
18133
|
status: 404,
|
|
17982
18134
|
check: true,
|
|
17983
|
-
dest:
|
|
18135
|
+
dest: import_path6.default.join("/", entryDirectory, "_next/static/not-found.txt"),
|
|
17984
18136
|
headers: {
|
|
17985
18137
|
"content-type": "text/plain; charset=utf-8"
|
|
17986
18138
|
}
|
|
@@ -17988,8 +18140,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17988
18140
|
// remove locale prefixes to check public files
|
|
17989
18141
|
...i18n ? [
|
|
17990
18142
|
{
|
|
17991
|
-
src: `^${
|
|
17992
|
-
dest: `${
|
|
18143
|
+
src: `^${import_path6.default.join("/", entryDirectory)}/?(?:${i18n.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})/(.*)`,
|
|
18144
|
+
dest: `${import_path6.default.join("/", entryDirectory, "/")}$1`,
|
|
17993
18145
|
check: true
|
|
17994
18146
|
}
|
|
17995
18147
|
] : [],
|
|
@@ -17997,7 +18149,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
17997
18149
|
// to allow checking for lambda
|
|
17998
18150
|
...isSharedLambdas || !i18n ? [] : [
|
|
17999
18151
|
{
|
|
18000
|
-
src: `${
|
|
18152
|
+
src: `${import_path6.default.join("/", entryDirectory, "/")}(?:${i18n?.locales.map((locale) => (0, import_escape_string_regexp3.default)(locale)).join("|")})/(.*)`,
|
|
18001
18153
|
dest: "/$1",
|
|
18002
18154
|
check: true
|
|
18003
18155
|
}
|
|
@@ -18010,8 +18162,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
18010
18162
|
// ensure we 404 for non-existent _next/data routes before
|
|
18011
18163
|
// trying page dynamic routes
|
|
18012
18164
|
{
|
|
18013
|
-
src:
|
|
18014
|
-
dest:
|
|
18165
|
+
src: import_path6.default.join("/", entryDirectory, "_next/data/(.*)"),
|
|
18166
|
+
dest: import_path6.default.join("/", entryDirectory, "404"),
|
|
18015
18167
|
status: 404,
|
|
18016
18168
|
check: true
|
|
18017
18169
|
},
|
|
@@ -18026,7 +18178,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
18026
18178
|
{
|
|
18027
18179
|
// This ensures we only match known emitted-by-Next.js files and not
|
|
18028
18180
|
// user-emitted files which may be missing a hash in their filename.
|
|
18029
|
-
src:
|
|
18181
|
+
src: import_path6.default.join(
|
|
18030
18182
|
"/",
|
|
18031
18183
|
entryDirectory,
|
|
18032
18184
|
`_next/static/(?:[^/]+/pages|pages|chunks|runtime|css|image|media|${escapedBuildId})/.+`
|
|
@@ -18045,7 +18197,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
18045
18197
|
{ handle: "error" },
|
|
18046
18198
|
...i18n && (static404Page || hasIsr404Page) ? [
|
|
18047
18199
|
{
|
|
18048
|
-
src: `${
|
|
18200
|
+
src: `${import_path6.default.join(
|
|
18049
18201
|
"/",
|
|
18050
18202
|
entryDirectory,
|
|
18051
18203
|
"/"
|
|
@@ -18055,16 +18207,16 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
18055
18207
|
caseSensitive: true
|
|
18056
18208
|
},
|
|
18057
18209
|
{
|
|
18058
|
-
src:
|
|
18210
|
+
src: import_path6.default.join("/", entryDirectory, ".*"),
|
|
18059
18211
|
dest: `/${i18n.defaultLocale}/404`,
|
|
18060
18212
|
status: 404
|
|
18061
18213
|
}
|
|
18062
18214
|
] : [
|
|
18063
18215
|
isSharedLambdas ? {
|
|
18064
|
-
src:
|
|
18216
|
+
src: import_path6.default.join("/", entryDirectory, ".*"),
|
|
18065
18217
|
// if static 404 is not present but we have pages/404.js
|
|
18066
18218
|
// it is a lambda due to _app getInitialProps
|
|
18067
|
-
dest:
|
|
18219
|
+
dest: import_path6.default.join(
|
|
18068
18220
|
"/",
|
|
18069
18221
|
static404Page ? static404Page : pageLambdaMap[page404Path]
|
|
18070
18222
|
),
|
|
@@ -18075,13 +18227,13 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
18075
18227
|
}
|
|
18076
18228
|
}
|
|
18077
18229
|
} : {
|
|
18078
|
-
src:
|
|
18230
|
+
src: import_path6.default.join("/", entryDirectory, ".*"),
|
|
18079
18231
|
// if static 404 is not present but we have pages/404.js
|
|
18080
18232
|
// it is a lambda due to _app getInitialProps
|
|
18081
|
-
dest: static404Page ?
|
|
18233
|
+
dest: static404Page ? import_path6.default.join("/", static404Page) : import_path6.default.join(
|
|
18082
18234
|
"/",
|
|
18083
18235
|
entryDirectory,
|
|
18084
|
-
hasPages404 && lambdas[
|
|
18236
|
+
hasPages404 && lambdas[import_path6.default.join("./", entryDirectory, "404")] ? "404" : "_error"
|
|
18085
18237
|
),
|
|
18086
18238
|
status: 404
|
|
18087
18239
|
}
|
|
@@ -18089,7 +18241,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
18089
18241
|
// static 500 page if present
|
|
18090
18242
|
...!hasStatic500 ? [] : i18n ? [
|
|
18091
18243
|
{
|
|
18092
|
-
src: `${
|
|
18244
|
+
src: `${import_path6.default.join(
|
|
18093
18245
|
"/",
|
|
18094
18246
|
entryDirectory,
|
|
18095
18247
|
"/"
|
|
@@ -18098,14 +18250,14 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
|
18098
18250
|
status: 500
|
|
18099
18251
|
},
|
|
18100
18252
|
{
|
|
18101
|
-
src:
|
|
18253
|
+
src: import_path6.default.join("/", entryDirectory, ".*"),
|
|
18102
18254
|
dest: `/${i18n.defaultLocale}/500`,
|
|
18103
18255
|
status: 500
|
|
18104
18256
|
}
|
|
18105
18257
|
] : [
|
|
18106
18258
|
{
|
|
18107
|
-
src:
|
|
18108
|
-
dest:
|
|
18259
|
+
src: import_path6.default.join("/", entryDirectory, ".*"),
|
|
18260
|
+
dest: import_path6.default.join("/", entryDirectory, "/500"),
|
|
18109
18261
|
status: 500
|
|
18110
18262
|
}
|
|
18111
18263
|
]
|
|
@@ -18120,11 +18272,11 @@ var diagnostics = async ({
|
|
|
18120
18272
|
workPath,
|
|
18121
18273
|
repoRootPath
|
|
18122
18274
|
}) => {
|
|
18123
|
-
const entryDirectory =
|
|
18124
|
-
const entryPath =
|
|
18125
|
-
const outputDirectory =
|
|
18275
|
+
const entryDirectory = import_path6.default.dirname(entrypoint);
|
|
18276
|
+
const entryPath = import_path6.default.join(workPath, entryDirectory);
|
|
18277
|
+
const outputDirectory = import_path6.default.join("./", config.outputDirectory || ".next");
|
|
18126
18278
|
const basePath = repoRootPath || workPath;
|
|
18127
|
-
const diagnosticsEntrypoint =
|
|
18279
|
+
const diagnosticsEntrypoint = import_path6.default.relative(basePath, entryPath);
|
|
18128
18280
|
(0, import_build_utils3.debug)(
|
|
18129
18281
|
`Reading diagnostics file in diagnosticsEntrypoint=${diagnosticsEntrypoint}`
|
|
18130
18282
|
);
|
|
@@ -18132,17 +18284,17 @@ var diagnostics = async ({
|
|
|
18132
18284
|
// Collect output in `.next/diagnostics`
|
|
18133
18285
|
...await (0, import_build_utils3.glob)(
|
|
18134
18286
|
"*",
|
|
18135
|
-
|
|
18287
|
+
import_path6.default.join(basePath, diagnosticsEntrypoint, outputDirectory, "diagnostics")
|
|
18136
18288
|
),
|
|
18137
18289
|
// Collect `.next/trace` file
|
|
18138
18290
|
...await (0, import_build_utils3.glob)(
|
|
18139
18291
|
"trace",
|
|
18140
|
-
|
|
18292
|
+
import_path6.default.join(basePath, diagnosticsEntrypoint, outputDirectory)
|
|
18141
18293
|
),
|
|
18142
18294
|
// Collect `.next/turbopack` file
|
|
18143
18295
|
...await (0, import_build_utils3.glob)(
|
|
18144
18296
|
"turbopack",
|
|
18145
|
-
|
|
18297
|
+
import_path6.default.join(basePath, diagnosticsEntrypoint, outputDirectory)
|
|
18146
18298
|
)
|
|
18147
18299
|
};
|
|
18148
18300
|
};
|
|
@@ -18153,9 +18305,9 @@ var prepareCache = async ({
|
|
|
18153
18305
|
config = {}
|
|
18154
18306
|
}) => {
|
|
18155
18307
|
(0, import_build_utils3.debug)("Preparing cache...");
|
|
18156
|
-
const entryDirectory =
|
|
18157
|
-
const entryPath =
|
|
18158
|
-
const outputDirectory =
|
|
18308
|
+
const entryDirectory = import_path6.default.dirname(entrypoint);
|
|
18309
|
+
const entryPath = import_path6.default.join(workPath, entryDirectory);
|
|
18310
|
+
const outputDirectory = import_path6.default.join("./", config.outputDirectory || ".next");
|
|
18159
18311
|
const nextVersionRange = await getNextVersionRange(entryPath);
|
|
18160
18312
|
const isLegacy = nextVersionRange && isLegacyNext(nextVersionRange);
|
|
18161
18313
|
if (isLegacy) {
|
|
@@ -18164,18 +18316,18 @@ var prepareCache = async ({
|
|
|
18164
18316
|
(0, import_build_utils3.debug)("Producing cache file manifest...");
|
|
18165
18317
|
const isMonorepo = repoRootPath && repoRootPath !== workPath;
|
|
18166
18318
|
const cacheBasePath = repoRootPath || workPath;
|
|
18167
|
-
const cacheEntrypoint =
|
|
18319
|
+
const cacheEntrypoint = import_path6.default.relative(cacheBasePath, entryPath);
|
|
18168
18320
|
const cache = {
|
|
18169
18321
|
...await (0, import_build_utils3.glob)(
|
|
18170
|
-
isMonorepo ? "**/node_modules/**" :
|
|
18322
|
+
isMonorepo ? "**/node_modules/**" : import_path6.default.join(cacheEntrypoint, "node_modules/**"),
|
|
18171
18323
|
cacheBasePath
|
|
18172
18324
|
),
|
|
18173
18325
|
...await (0, import_build_utils3.glob)(
|
|
18174
|
-
|
|
18326
|
+
import_path6.default.join(cacheEntrypoint, outputDirectory, "cache/**"),
|
|
18175
18327
|
cacheBasePath
|
|
18176
18328
|
),
|
|
18177
18329
|
...await (0, import_build_utils3.glob)(
|
|
18178
|
-
isMonorepo ? "**/.yarn/cache/**" :
|
|
18330
|
+
isMonorepo ? "**/.yarn/cache/**" : import_path6.default.join(cacheEntrypoint, ".yarn/cache/**"),
|
|
18179
18331
|
cacheBasePath
|
|
18180
18332
|
)
|
|
18181
18333
|
};
|