@vercel/next 3.3.2 → 3.3.4
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/edge-function-source/constants.js +2 -3
- package/dist/index.js +52 -51
- package/dist/server-build.js +1 -11
- package/dist/utils.js +31 -15
- package/package.json +3 -4
@@ -1,9 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.EDGE_FUNCTION_SIZE_LIMIT = void 0;
|
4
|
-
const
|
5
|
-
const MIB = 1024 * KIB;
|
4
|
+
const utils_1 = require("../utils");
|
6
5
|
/**
|
7
6
|
* The maximum size of a *compressed* edge function.
|
8
7
|
*/
|
9
|
-
exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * MIB;
|
8
|
+
exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * utils_1.MIB;
|
package/dist/index.js
CHANGED
@@ -43565,18 +43565,17 @@ exports.default = createServerlessConfig;
|
|
43565
43565
|
/***/ }),
|
43566
43566
|
|
43567
43567
|
/***/ 6974:
|
43568
|
-
/***/ ((__unused_webpack_module, exports) => {
|
43568
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
43569
43569
|
|
43570
43570
|
"use strict";
|
43571
43571
|
|
43572
43572
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
43573
43573
|
exports.EDGE_FUNCTION_SIZE_LIMIT = void 0;
|
43574
|
-
const
|
43575
|
-
const MIB = 1024 * KIB;
|
43574
|
+
const utils_1 = __webpack_require__(4411);
|
43576
43575
|
/**
|
43577
43576
|
* The maximum size of a *compressed* edge function.
|
43578
43577
|
*/
|
43579
|
-
exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * MIB;
|
43578
|
+
exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * utils_1.MIB;
|
43580
43579
|
|
43581
43580
|
|
43582
43581
|
/***/ }),
|
@@ -43779,7 +43778,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
43779
43778
|
(0, utils_1.validateEntrypoint)(entrypoint);
|
43780
43779
|
// Limit for max size each lambda can be, 50 MB if no custom limit
|
43781
43780
|
const lambdaCompressedByteLimit = (config.maxLambdaSize ||
|
43782
|
-
50 *
|
43781
|
+
50 * utils_1.MIB);
|
43783
43782
|
let entryDirectory = path_1.default.dirname(entrypoint);
|
43784
43783
|
let entryPath = path_1.default.join(workPath, entryDirectory);
|
43785
43784
|
// allow testing root directory setting with vercel.json
|
@@ -43971,6 +43970,20 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
43971
43970
|
});
|
43972
43971
|
}
|
43973
43972
|
(0, build_utils_1.debug)('build command exited');
|
43973
|
+
let buildOutputVersion;
|
43974
|
+
try {
|
43975
|
+
const data = await (0, fs_extra_1.readJSON)(path_1.default.join(outputDirectory, 'output/config.json'));
|
43976
|
+
buildOutputVersion = data.version;
|
43977
|
+
}
|
43978
|
+
catch (_) {
|
43979
|
+
// tolerate for older versions
|
43980
|
+
}
|
43981
|
+
if (buildOutputVersion) {
|
43982
|
+
return {
|
43983
|
+
buildOutputPath: path_1.default.join(outputDirectory, 'output'),
|
43984
|
+
buildOutputVersion,
|
43985
|
+
};
|
43986
|
+
}
|
43974
43987
|
let appMountPrefixNoTrailingSlash = path_1.default.posix
|
43975
43988
|
.join('/', entryDirectory)
|
43976
43989
|
.replace(/\/+$/, '');
|
@@ -44215,16 +44228,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
44215
44228
|
});
|
44216
44229
|
return {
|
44217
44230
|
output,
|
44218
|
-
images: imagesManifest
|
44219
|
-
? {
|
44220
|
-
domains: imagesManifest.images.domains,
|
44221
|
-
sizes: imagesManifest.images.sizes,
|
44222
|
-
remotePatterns: imagesManifest.images.remotePatterns,
|
44223
|
-
minimumCacheTTL: imagesManifest.images.minimumCacheTTL,
|
44224
|
-
dangerouslyAllowSVG: imagesManifest.images.dangerouslyAllowSVG,
|
44225
|
-
contentSecurityPolicy: imagesManifest.images.contentSecurityPolicy,
|
44226
|
-
}
|
44227
|
-
: undefined,
|
44231
|
+
images: (0, utils_1.getImagesConfig)(imagesManifest),
|
44228
44232
|
routes: [
|
44229
44233
|
...privateOutputs.routes,
|
44230
44234
|
...headers,
|
@@ -45166,16 +45170,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
|
|
45166
45170
|
...privateOutputs.files,
|
45167
45171
|
},
|
45168
45172
|
wildcard: wildcardConfig,
|
45169
|
-
images: imagesManifest
|
45170
|
-
? {
|
45171
|
-
domains: imagesManifest.images.domains,
|
45172
|
-
sizes: imagesManifest.images.sizes,
|
45173
|
-
remotePatterns: imagesManifest.images.remotePatterns,
|
45174
|
-
minimumCacheTTL: imagesManifest.images.minimumCacheTTL,
|
45175
|
-
dangerouslyAllowSVG: imagesManifest.images.dangerouslyAllowSVG,
|
45176
|
-
contentSecurityPolicy: imagesManifest.images.contentSecurityPolicy,
|
45177
|
-
}
|
45178
|
-
: undefined,
|
45173
|
+
images: (0, utils_1.getImagesConfig)(imagesManifest),
|
45179
45174
|
/*
|
45180
45175
|
Desired routes order
|
45181
45176
|
- Runtime headers
|
@@ -46591,17 +46586,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
46591
46586
|
}
|
46592
46587
|
return {
|
46593
46588
|
wildcard: wildcardConfig,
|
46594
|
-
images: imagesManifest
|
46595
|
-
? {
|
46596
|
-
domains: imagesManifest.images.domains,
|
46597
|
-
sizes: imagesManifest.images.sizes,
|
46598
|
-
remotePatterns: imagesManifest.images.remotePatterns,
|
46599
|
-
minimumCacheTTL: imagesManifest.images.minimumCacheTTL,
|
46600
|
-
formats: imagesManifest.images.formats,
|
46601
|
-
dangerouslyAllowSVG: imagesManifest.images.dangerouslyAllowSVG,
|
46602
|
-
contentSecurityPolicy: imagesManifest.images.contentSecurityPolicy,
|
46603
|
-
}
|
46604
|
-
: undefined,
|
46589
|
+
images: (0, utils_1.getImagesConfig)(imagesManifest),
|
46605
46590
|
output: {
|
46606
46591
|
...publicDirectoryFiles,
|
46607
46592
|
...lambdas,
|
@@ -47174,7 +47159,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47174
47159
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
47175
47160
|
};
|
47176
47161
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
47177
|
-
exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = void 0;
|
47162
|
+
exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getImagesConfig = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = exports.MIB = exports.KIB = void 0;
|
47178
47163
|
const build_utils_1 = __webpack_require__(3445);
|
47179
47164
|
const async_sema_1 = __webpack_require__(7916);
|
47180
47165
|
const buffer_crc32_1 = __importDefault(__webpack_require__(360));
|
@@ -47187,12 +47172,13 @@ const url_1 = __importDefault(__webpack_require__(8835));
|
|
47187
47172
|
const escape_string_regexp_1 = __importDefault(__webpack_require__(1426));
|
47188
47173
|
const _1 = __webpack_require__(2855);
|
47189
47174
|
const text_table_1 = __importDefault(__webpack_require__(3221));
|
47190
|
-
const pretty_bytes_1 = __importDefault(__webpack_require__(539));
|
47191
47175
|
const get_edge_function_source_1 = __webpack_require__(8055);
|
47192
47176
|
const sourcemapped_1 = __webpack_require__(9239);
|
47193
47177
|
const bytes_1 = __importDefault(__webpack_require__(1446));
|
47194
|
-
|
47195
|
-
exports.
|
47178
|
+
exports.KIB = 1024;
|
47179
|
+
exports.MIB = 1024 * exports.KIB;
|
47180
|
+
const prettyBytes = (n) => (0, bytes_1.default)(n, { unitSeparator: ' ' });
|
47181
|
+
exports.prettyBytes = prettyBytes;
|
47196
47182
|
// Identify /[param]/ in route string
|
47197
47183
|
// eslint-disable-next-line no-useless-escape
|
47198
47184
|
const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/;
|
@@ -47281,6 +47267,21 @@ async function getNextConfig(workPath, entryPath) {
|
|
47281
47267
|
return null;
|
47282
47268
|
}
|
47283
47269
|
exports.getNextConfig = getNextConfig;
|
47270
|
+
function getImagesConfig(imagesManifest) {
|
47271
|
+
return imagesManifest?.images?.loader === 'default' &&
|
47272
|
+
imagesManifest.images?.unoptimized !== true
|
47273
|
+
? {
|
47274
|
+
domains: imagesManifest.images.domains,
|
47275
|
+
sizes: imagesManifest.images.sizes,
|
47276
|
+
remotePatterns: imagesManifest.images.remotePatterns,
|
47277
|
+
minimumCacheTTL: imagesManifest.images.minimumCacheTTL,
|
47278
|
+
formats: imagesManifest.images.formats,
|
47279
|
+
dangerouslyAllowSVG: imagesManifest.images.dangerouslyAllowSVG,
|
47280
|
+
contentSecurityPolicy: imagesManifest.images.contentSecurityPolicy,
|
47281
|
+
}
|
47282
|
+
: undefined;
|
47283
|
+
}
|
47284
|
+
exports.getImagesConfig = getImagesConfig;
|
47284
47285
|
function normalizePage(page) {
|
47285
47286
|
// Resolve on anything that doesn't start with `/`
|
47286
47287
|
if (!page.startsWith('/')) {
|
@@ -47940,9 +47941,9 @@ function addLocaleOrDefault(pathname, routesManifest, locale) {
|
|
47940
47941
|
: pathname;
|
47941
47942
|
}
|
47942
47943
|
exports.addLocaleOrDefault = addLocaleOrDefault;
|
47943
|
-
exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 *
|
47944
|
-
const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 *
|
47945
|
-
const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 *
|
47944
|
+
exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * exports.MIB;
|
47945
|
+
const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * exports.MIB;
|
47946
|
+
const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * exports.KIB;
|
47946
47947
|
async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes, pageTraces, compressedPages, tracedPseudoLayer, initialPseudoLayer, initialPseudoLayerUncompressed, lambdaCompressedByteLimit, internalPages, pageExtensions, }) {
|
47947
47948
|
const groups = [];
|
47948
47949
|
for (const page of pages) {
|
@@ -48070,14 +48071,14 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
|
|
48070
48071
|
})
|
48071
48072
|
.forEach(depKey => {
|
48072
48073
|
const dep = dependencies[depKey];
|
48073
|
-
if (dep.compressed < 100 *
|
48074
|
+
if (dep.compressed < 100 * exports.KIB && dep.uncompressed < 500 * exports.KIB) {
|
48074
48075
|
// ignore smaller dependencies to reduce noise
|
48075
48076
|
return;
|
48076
48077
|
}
|
48077
48078
|
exceededLimitOutput.push([
|
48078
48079
|
depKey,
|
48079
|
-
(0,
|
48080
|
-
(0,
|
48080
|
+
(0, exports.prettyBytes)(dep.uncompressed),
|
48081
|
+
(0, exports.prettyBytes)(dep.compressed),
|
48081
48082
|
]);
|
48082
48083
|
numLargeDependencies += 1;
|
48083
48084
|
});
|
@@ -48089,8 +48090,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
|
|
48089
48090
|
exceededLimitOutput.push([]);
|
48090
48091
|
exceededLimitOutput.push([
|
48091
48092
|
'All dependencies',
|
48092
|
-
(0,
|
48093
|
-
(0,
|
48093
|
+
(0, exports.prettyBytes)(pseudoLayerUncompressedBytes),
|
48094
|
+
(0, exports.prettyBytes)(pseudoLayerBytes),
|
48094
48095
|
]);
|
48095
48096
|
console.log((0, text_table_1.default)(exceededLimitOutput, {
|
48096
48097
|
align: ['l', 'r', 'r'],
|
@@ -48099,8 +48100,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
|
|
48099
48100
|
exports.outputFunctionFileSizeInfo = outputFunctionFileSizeInfo;
|
48100
48101
|
const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, compressedPages) => {
|
48101
48102
|
// show debug info if within 5 MB of exceeding the limit
|
48102
|
-
const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 *
|
48103
|
-
const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 *
|
48103
|
+
const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 * exports.MIB;
|
48104
|
+
const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 * exports.MIB;
|
48104
48105
|
let numExceededLimit = 0;
|
48105
48106
|
let numCloseToLimit = 0;
|
48106
48107
|
let loggedHeadInfo = false;
|
@@ -48127,7 +48128,7 @@ const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, com
|
|
48127
48128
|
for (const group of filteredGroups) {
|
48128
48129
|
if (!loggedHeadInfo) {
|
48129
48130
|
if (numExceededLimit || numCloseToLimit) {
|
48130
|
-
console.log(`Warning: Max serverless function size of ${(0,
|
48131
|
+
console.log(`Warning: Max serverless function size of ${(0, exports.prettyBytes)(compressedSizeLimit)} compressed or ${(0, exports.prettyBytes)(exports.MAX_UNCOMPRESSED_LAMBDA_SIZE)} uncompressed${numExceededLimit ? '' : ' almost'} reached`);
|
48131
48132
|
}
|
48132
48133
|
else {
|
48133
48134
|
console.log(`Serverless function size info`);
|
package/dist/server-build.js
CHANGED
@@ -680,17 +680,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
680
680
|
}
|
681
681
|
return {
|
682
682
|
wildcard: wildcardConfig,
|
683
|
-
images: imagesManifest
|
684
|
-
? {
|
685
|
-
domains: imagesManifest.images.domains,
|
686
|
-
sizes: imagesManifest.images.sizes,
|
687
|
-
remotePatterns: imagesManifest.images.remotePatterns,
|
688
|
-
minimumCacheTTL: imagesManifest.images.minimumCacheTTL,
|
689
|
-
formats: imagesManifest.images.formats,
|
690
|
-
dangerouslyAllowSVG: imagesManifest.images.dangerouslyAllowSVG,
|
691
|
-
contentSecurityPolicy: imagesManifest.images.contentSecurityPolicy,
|
692
|
-
}
|
693
|
-
: undefined,
|
683
|
+
images: (0, utils_1.getImagesConfig)(imagesManifest),
|
694
684
|
output: {
|
695
685
|
...publicDirectoryFiles,
|
696
686
|
...lambdas,
|
package/dist/utils.js
CHANGED
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
23
|
};
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
-
exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = void 0;
|
25
|
+
exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getImagesConfig = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = exports.MIB = exports.KIB = void 0;
|
26
26
|
const build_utils_1 = require("@vercel/build-utils");
|
27
27
|
const async_sema_1 = require("async-sema");
|
28
28
|
const buffer_crc32_1 = __importDefault(require("buffer-crc32"));
|
@@ -35,12 +35,13 @@ const url_1 = __importDefault(require("url"));
|
|
35
35
|
const escape_string_regexp_1 = __importDefault(require("escape-string-regexp"));
|
36
36
|
const _1 = require(".");
|
37
37
|
const text_table_1 = __importDefault(require("text-table"));
|
38
|
-
const pretty_bytes_1 = __importDefault(require("pretty-bytes"));
|
39
38
|
const get_edge_function_source_1 = require("./edge-function-source/get-edge-function-source");
|
40
39
|
const sourcemapped_1 = require("./sourcemapped");
|
41
40
|
const bytes_1 = __importDefault(require("bytes"));
|
42
|
-
|
43
|
-
exports.
|
41
|
+
exports.KIB = 1024;
|
42
|
+
exports.MIB = 1024 * exports.KIB;
|
43
|
+
const prettyBytes = (n) => (0, bytes_1.default)(n, { unitSeparator: ' ' });
|
44
|
+
exports.prettyBytes = prettyBytes;
|
44
45
|
// Identify /[param]/ in route string
|
45
46
|
// eslint-disable-next-line no-useless-escape
|
46
47
|
const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/;
|
@@ -129,6 +130,21 @@ async function getNextConfig(workPath, entryPath) {
|
|
129
130
|
return null;
|
130
131
|
}
|
131
132
|
exports.getNextConfig = getNextConfig;
|
133
|
+
function getImagesConfig(imagesManifest) {
|
134
|
+
return imagesManifest?.images?.loader === 'default' &&
|
135
|
+
imagesManifest.images?.unoptimized !== true
|
136
|
+
? {
|
137
|
+
domains: imagesManifest.images.domains,
|
138
|
+
sizes: imagesManifest.images.sizes,
|
139
|
+
remotePatterns: imagesManifest.images.remotePatterns,
|
140
|
+
minimumCacheTTL: imagesManifest.images.minimumCacheTTL,
|
141
|
+
formats: imagesManifest.images.formats,
|
142
|
+
dangerouslyAllowSVG: imagesManifest.images.dangerouslyAllowSVG,
|
143
|
+
contentSecurityPolicy: imagesManifest.images.contentSecurityPolicy,
|
144
|
+
}
|
145
|
+
: undefined;
|
146
|
+
}
|
147
|
+
exports.getImagesConfig = getImagesConfig;
|
132
148
|
function normalizePage(page) {
|
133
149
|
// Resolve on anything that doesn't start with `/`
|
134
150
|
if (!page.startsWith('/')) {
|
@@ -788,9 +804,9 @@ function addLocaleOrDefault(pathname, routesManifest, locale) {
|
|
788
804
|
: pathname;
|
789
805
|
}
|
790
806
|
exports.addLocaleOrDefault = addLocaleOrDefault;
|
791
|
-
exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 *
|
792
|
-
const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 *
|
793
|
-
const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 *
|
807
|
+
exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * exports.MIB;
|
808
|
+
const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * exports.MIB;
|
809
|
+
const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * exports.KIB;
|
794
810
|
async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes, pageTraces, compressedPages, tracedPseudoLayer, initialPseudoLayer, initialPseudoLayerUncompressed, lambdaCompressedByteLimit, internalPages, pageExtensions, }) {
|
795
811
|
const groups = [];
|
796
812
|
for (const page of pages) {
|
@@ -918,14 +934,14 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
|
|
918
934
|
})
|
919
935
|
.forEach(depKey => {
|
920
936
|
const dep = dependencies[depKey];
|
921
|
-
if (dep.compressed < 100 *
|
937
|
+
if (dep.compressed < 100 * exports.KIB && dep.uncompressed < 500 * exports.KIB) {
|
922
938
|
// ignore smaller dependencies to reduce noise
|
923
939
|
return;
|
924
940
|
}
|
925
941
|
exceededLimitOutput.push([
|
926
942
|
depKey,
|
927
|
-
(0,
|
928
|
-
(0,
|
943
|
+
(0, exports.prettyBytes)(dep.uncompressed),
|
944
|
+
(0, exports.prettyBytes)(dep.compressed),
|
929
945
|
]);
|
930
946
|
numLargeDependencies += 1;
|
931
947
|
});
|
@@ -937,8 +953,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
|
|
937
953
|
exceededLimitOutput.push([]);
|
938
954
|
exceededLimitOutput.push([
|
939
955
|
'All dependencies',
|
940
|
-
(0,
|
941
|
-
(0,
|
956
|
+
(0, exports.prettyBytes)(pseudoLayerUncompressedBytes),
|
957
|
+
(0, exports.prettyBytes)(pseudoLayerBytes),
|
942
958
|
]);
|
943
959
|
console.log((0, text_table_1.default)(exceededLimitOutput, {
|
944
960
|
align: ['l', 'r', 'r'],
|
@@ -947,8 +963,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
|
|
947
963
|
exports.outputFunctionFileSizeInfo = outputFunctionFileSizeInfo;
|
948
964
|
const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, compressedPages) => {
|
949
965
|
// show debug info if within 5 MB of exceeding the limit
|
950
|
-
const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 *
|
951
|
-
const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 *
|
966
|
+
const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 * exports.MIB;
|
967
|
+
const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 * exports.MIB;
|
952
968
|
let numExceededLimit = 0;
|
953
969
|
let numCloseToLimit = 0;
|
954
970
|
let loggedHeadInfo = false;
|
@@ -975,7 +991,7 @@ const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, com
|
|
975
991
|
for (const group of filteredGroups) {
|
976
992
|
if (!loggedHeadInfo) {
|
977
993
|
if (numExceededLimit || numCloseToLimit) {
|
978
|
-
console.log(`Warning: Max serverless function size of ${(0,
|
994
|
+
console.log(`Warning: Max serverless function size of ${(0, exports.prettyBytes)(compressedSizeLimit)} compressed or ${(0, exports.prettyBytes)(exports.MAX_UNCOMPRESSED_LAMBDA_SIZE)} uncompressed${numExceededLimit ? '' : ' almost'} reached`);
|
979
995
|
}
|
980
996
|
else {
|
981
997
|
console.log(`Serverless function size info`);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "3.3.
|
3
|
+
"version": "3.3.4",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"@types/semver": "6.0.0",
|
46
46
|
"@types/text-table": "0.2.1",
|
47
47
|
"@types/webpack-sources": "3.2.0",
|
48
|
-
"@vercel/build-utils": "5.7.
|
48
|
+
"@vercel/build-utils": "5.7.1",
|
49
49
|
"@vercel/nft": "0.22.1",
|
50
50
|
"@vercel/routing-utils": "2.1.3",
|
51
51
|
"async-sema": "3.0.1",
|
@@ -61,7 +61,6 @@
|
|
61
61
|
"get-port": "5.0.0",
|
62
62
|
"nanoid": "3.3.4",
|
63
63
|
"ndjson": "2.0.0",
|
64
|
-
"pretty-bytes": "5.6.0",
|
65
64
|
"resolve-from": "5.0.0",
|
66
65
|
"semver": "6.1.1",
|
67
66
|
"set-cookie-parser": "2.4.6",
|
@@ -71,5 +70,5 @@
|
|
71
70
|
"typescript": "4.5.2",
|
72
71
|
"webpack-sources": "3.2.3"
|
73
72
|
},
|
74
|
-
"gitHead": "
|
73
|
+
"gitHead": "04e9f771dff574e48d4128acd883935c50511425"
|
75
74
|
}
|