next 15.6.0-canary.22 → 15.6.0-canary.23
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/bin/next +1 -1
- package/dist/build/index.js +3 -3
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack/plugins/build-manifest-plugin-utils.d.ts +17 -0
- package/dist/build/webpack/plugins/build-manifest-plugin-utils.js +79 -0
- package/dist/build/webpack/plugins/build-manifest-plugin-utils.js.map +1 -0
- package/dist/build/webpack/plugins/build-manifest-plugin.d.ts +1 -16
- package/dist/build/webpack/plugins/build-manifest-plugin.js +8 -70
- package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/webpack/webpack.js +34 -37
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/plugins/build-manifest-plugin-utils.js +52 -0
- package/dist/esm/build/webpack/plugins/build-manifest-plugin-utils.js.map +1 -0
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +1 -50
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/config-utils.js +0 -2
- package/dist/esm/server/config-utils.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js +1 -1
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/esm/shared/lib/turbopack/manifest-loader.js +1 -1
- package/dist/esm/shared/lib/turbopack/manifest-loader.js.map +1 -1
- package/dist/server/config-utils.js +0 -2
- package/dist/server/config-utils.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/router-utils/setup-dev-bundler.js +2 -2
- package/dist/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/shared/lib/turbopack/manifest-loader.js +7 -7
- package/dist/shared/lib/turbopack/manifest-loader.js.map +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
package/dist/bin/next
CHANGED
@@ -79,7 +79,7 @@ const program = new NextRootCommand();
|
|
79
79
|
program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
|
80
80
|
formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
|
81
81
|
subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
|
82
|
-
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.6.0-canary.
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.6.0-canary.23"}`, '-v, --version', 'Outputs the Next.js version.');
|
83
83
|
program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--debug-prerender', 'Enables debug mode for prerendering. Not for production use!').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').option('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
|
84
84
|
'compile',
|
85
85
|
'generate',
|
package/dist/build/index.js
CHANGED
@@ -371,7 +371,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
371
371
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
372
372
|
buildMode: experimentalBuildMode,
|
373
373
|
isTurboBuild: String(isTurbopack),
|
374
|
-
version: "15.6.0-canary.
|
374
|
+
version: "15.6.0-canary.23"
|
375
375
|
});
|
376
376
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
377
377
|
_buildcontext.NextBuildContext.dir = dir;
|
@@ -850,7 +850,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
850
850
|
// Files outside of the distDir can be "type": "module"
|
851
851
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
852
852
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
853
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.
|
853
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.23");
|
854
854
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
855
855
|
buildStage: 'start'
|
856
856
|
});
|
@@ -2499,7 +2499,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
2499
2499
|
distDir,
|
2500
2500
|
config,
|
2501
2501
|
staticPages,
|
2502
|
-
nextVersion: "15.6.0-canary.
|
2502
|
+
nextVersion: "15.6.0-canary.23",
|
2503
2503
|
tracingRoot: outputFileTracingRoot,
|
2504
2504
|
hasNodeMiddleware,
|
2505
2505
|
hasInstrumentationHook,
|
package/dist/build/swc/index.js
CHANGED
@@ -130,7 +130,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
130
130
|
}
|
131
131
|
return newObj;
|
132
132
|
}
|
133
|
-
const nextVersion = "15.6.0-canary.
|
133
|
+
const nextVersion = "15.6.0-canary.23";
|
134
134
|
const ArchName = (0, _os.arch)();
|
135
135
|
const PlatformName = (0, _os.platform)();
|
136
136
|
function infoLog(...args) {
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { CustomRoutes, Rewrite } from '../../../lib/load-custom-routes';
|
2
|
+
import type { BuildManifest } from '../../../server/get-page-files';
|
3
|
+
export type ClientBuildManifest = {
|
4
|
+
[key: string]: string[];
|
5
|
+
};
|
6
|
+
export declare const srcEmptySsgManifest = "self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()";
|
7
|
+
export declare const processRoute: (r: Rewrite) => {
|
8
|
+
source: string;
|
9
|
+
destination: string;
|
10
|
+
basePath?: false;
|
11
|
+
locale?: false;
|
12
|
+
has?: import("../../../lib/load-custom-routes").RouteHas[];
|
13
|
+
missing?: import("../../../lib/load-custom-routes").RouteHas[];
|
14
|
+
internal?: boolean;
|
15
|
+
};
|
16
|
+
export declare function normalizeRewritesForBuildManifest(rewrites: CustomRoutes['rewrites']): CustomRoutes['rewrites'];
|
17
|
+
export declare function createEdgeRuntimeManifest(originAssetMap: Partial<BuildManifest>): string;
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
0 && (module.exports = {
|
6
|
+
createEdgeRuntimeManifest: null,
|
7
|
+
normalizeRewritesForBuildManifest: null,
|
8
|
+
processRoute: null,
|
9
|
+
srcEmptySsgManifest: null
|
10
|
+
});
|
11
|
+
function _export(target, all) {
|
12
|
+
for(var name in all)Object.defineProperty(target, name, {
|
13
|
+
enumerable: true,
|
14
|
+
get: all[name]
|
15
|
+
});
|
16
|
+
}
|
17
|
+
_export(exports, {
|
18
|
+
createEdgeRuntimeManifest: function() {
|
19
|
+
return createEdgeRuntimeManifest;
|
20
|
+
},
|
21
|
+
normalizeRewritesForBuildManifest: function() {
|
22
|
+
return normalizeRewritesForBuildManifest;
|
23
|
+
},
|
24
|
+
processRoute: function() {
|
25
|
+
return processRoute;
|
26
|
+
},
|
27
|
+
srcEmptySsgManifest: function() {
|
28
|
+
return srcEmptySsgManifest;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`;
|
32
|
+
function normalizeRewrite(item) {
|
33
|
+
return {
|
34
|
+
has: item.has,
|
35
|
+
source: item.source,
|
36
|
+
destination: item.destination
|
37
|
+
};
|
38
|
+
}
|
39
|
+
const processRoute = (r)=>{
|
40
|
+
var _rewrite_destination;
|
41
|
+
const rewrite = {
|
42
|
+
...r
|
43
|
+
};
|
44
|
+
// omit external rewrite destinations since these aren't
|
45
|
+
// handled client-side
|
46
|
+
if (!(rewrite == null ? void 0 : (_rewrite_destination = rewrite.destination) == null ? void 0 : _rewrite_destination.startsWith('/'))) {
|
47
|
+
delete rewrite.destination;
|
48
|
+
}
|
49
|
+
return rewrite;
|
50
|
+
};
|
51
|
+
function normalizeRewritesForBuildManifest(rewrites) {
|
52
|
+
var _rewrites_afterFiles_map, _rewrites_afterFiles, _rewrites_beforeFiles_map, _rewrites_beforeFiles, _rewrites_fallback_map, _rewrites_fallback;
|
53
|
+
return {
|
54
|
+
afterFiles: (_rewrites_afterFiles = rewrites.afterFiles) == null ? void 0 : (_rewrites_afterFiles_map = _rewrites_afterFiles.map(processRoute)) == null ? void 0 : _rewrites_afterFiles_map.map((item)=>normalizeRewrite(item)),
|
55
|
+
beforeFiles: (_rewrites_beforeFiles = rewrites.beforeFiles) == null ? void 0 : (_rewrites_beforeFiles_map = _rewrites_beforeFiles.map(processRoute)) == null ? void 0 : _rewrites_beforeFiles_map.map((item)=>normalizeRewrite(item)),
|
56
|
+
fallback: (_rewrites_fallback = rewrites.fallback) == null ? void 0 : (_rewrites_fallback_map = _rewrites_fallback.map(processRoute)) == null ? void 0 : _rewrites_fallback_map.map((item)=>normalizeRewrite(item))
|
57
|
+
};
|
58
|
+
}
|
59
|
+
function createEdgeRuntimeManifest(originAssetMap) {
|
60
|
+
const manifestFilenames = [
|
61
|
+
'_buildManifest.js',
|
62
|
+
'_ssgManifest.js'
|
63
|
+
];
|
64
|
+
const assetMap = {
|
65
|
+
...originAssetMap,
|
66
|
+
lowPriorityFiles: []
|
67
|
+
};
|
68
|
+
// we use globalThis here because middleware can be node
|
69
|
+
// which doesn't have "self"
|
70
|
+
const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(assetMap, null, 2)};\n`;
|
71
|
+
// edge lowPriorityFiles item: '"/static/" + process.env.__NEXT_BUILD_ID + "/low-priority.js"'.
|
72
|
+
// Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.
|
73
|
+
const lowPriorityFilesCode = `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\n` + manifestFilenames.map((filename)=>{
|
74
|
+
return `"/static/" + process.env.__NEXT_BUILD_ID + "/${filename}",\n`;
|
75
|
+
}).join(',') + `\n];`;
|
76
|
+
return manifestDefCode + lowPriorityFilesCode;
|
77
|
+
}
|
78
|
+
|
79
|
+
//# sourceMappingURL=build-manifest-plugin-utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/build/webpack/plugins/build-manifest-plugin-utils.ts"],"sourcesContent":["import type { CustomRoutes, Rewrite } from '../../../lib/load-custom-routes'\nimport type { BuildManifest } from '../../../server/get-page-files'\n\nexport type ClientBuildManifest = {\n [key: string]: string[]\n}\n\n// Add the runtime ssg manifest file as a lazy-loaded file dependency.\n// We also stub this file out for development mode (when it is not\n// generated).\nexport const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`\n\nfunction normalizeRewrite(item: {\n source: string\n destination: string\n has?: any\n}): CustomRoutes['rewrites']['beforeFiles'][0] {\n return {\n has: item.has,\n source: item.source,\n destination: item.destination,\n }\n}\n\nexport const processRoute = (r: Rewrite) => {\n const rewrite = { ...r }\n\n // omit external rewrite destinations since these aren't\n // handled client-side\n if (!rewrite?.destination?.startsWith('/')) {\n delete (rewrite as any).destination\n }\n return rewrite\n}\n\nexport function normalizeRewritesForBuildManifest(\n rewrites: CustomRoutes['rewrites']\n): CustomRoutes['rewrites'] {\n return {\n afterFiles: rewrites.afterFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n beforeFiles: rewrites.beforeFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n fallback: rewrites.fallback\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n }\n}\n\nexport function createEdgeRuntimeManifest(\n originAssetMap: Partial<BuildManifest>\n): string {\n const manifestFilenames = ['_buildManifest.js', '_ssgManifest.js']\n\n const assetMap: Partial<BuildManifest> = {\n ...originAssetMap,\n lowPriorityFiles: [],\n }\n\n // we use globalThis here because middleware can be node\n // which doesn't have \"self\"\n const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(\n assetMap,\n null,\n 2\n )};\\n`\n // edge lowPriorityFiles item: '\"/static/\" + process.env.__NEXT_BUILD_ID + \"/low-priority.js\"'.\n // Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.\n const lowPriorityFilesCode =\n `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\\n` +\n manifestFilenames\n .map((filename) => {\n return `\"/static/\" + process.env.__NEXT_BUILD_ID + \"/${filename}\",\\n`\n })\n .join(',') +\n `\\n];`\n\n return manifestDefCode + lowPriorityFilesCode\n}\n"],"names":["createEdgeRuntimeManifest","normalizeRewritesForBuildManifest","processRoute","srcEmptySsgManifest","normalizeRewrite","item","has","source","destination","r","rewrite","startsWith","rewrites","afterFiles","map","beforeFiles","fallback","originAssetMap","manifestFilenames","assetMap","lowPriorityFiles","manifestDefCode","JSON","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AC5B,MAAMC,kBAAkB,CAAC,8BAA8B,EAAEC,KAAKC,SAAS,CACrEJ,UACA,MACA,GACA,GAAG,CAAC;IACN,+FAA+F;IAC/F,gIAAgI;IAChI,MAAMK,uBACJ,CAAC,kDAAkD,CAAC,GACpDN,kBACGJ,GAAG,CAAC,CAACW;QACJ,OAAO,CAAC,6CAA6C,EAAEA,SAAS,IAAI,CAAC;IACvE,GACCC,IAAI,CAAC,OACR,CAAC,IAAI,CAAC;IAER,OAAOL,kBAAkBG;AAC3B","ignoreList":[0]}
|
@@ -1,27 +1,12 @@
|
|
1
1
|
import type { BloomFilter } from '../../../shared/lib/bloom-filter';
|
2
|
-
import type {
|
2
|
+
import type { CustomRoutes } from '../../../lib/load-custom-routes';
|
3
3
|
import { webpack } from 'next/dist/compiled/webpack/webpack';
|
4
4
|
import type { BuildManifest } from '../../../server/get-page-files';
|
5
|
-
export type ClientBuildManifest = {
|
6
|
-
[key: string]: string[];
|
7
|
-
};
|
8
|
-
export declare const srcEmptySsgManifest = "self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()";
|
9
|
-
export declare function createEdgeRuntimeManifest(originAssetMap: Partial<BuildManifest>): string;
|
10
|
-
export declare function normalizeRewritesForBuildManifest(rewrites: CustomRoutes['rewrites']): CustomRoutes['rewrites'];
|
11
5
|
export declare function generateClientManifest(assetMap: BuildManifest, rewrites: CustomRoutes['rewrites'], clientRouterFilters?: {
|
12
6
|
staticFilter: ReturnType<BloomFilter['export']>;
|
13
7
|
dynamicFilter: ReturnType<BloomFilter['export']>;
|
14
8
|
}, compiler?: any, compilation?: any): string | undefined;
|
15
9
|
export declare function getEntrypointFiles(entrypoint: any): string[];
|
16
|
-
export declare const processRoute: (r: Rewrite) => {
|
17
|
-
source: string;
|
18
|
-
destination: string;
|
19
|
-
basePath?: false;
|
20
|
-
locale?: false;
|
21
|
-
has?: import("../../../lib/load-custom-routes").RouteHas[];
|
22
|
-
missing?: import("../../../lib/load-custom-routes").RouteHas[];
|
23
|
-
internal?: boolean;
|
24
|
-
};
|
25
10
|
export default class BuildManifestPlugin {
|
26
11
|
private buildId;
|
27
12
|
private rewrites;
|
@@ -3,13 +3,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
4
4
|
});
|
5
5
|
0 && (module.exports = {
|
6
|
-
createEdgeRuntimeManifest: null,
|
7
6
|
default: null,
|
8
7
|
generateClientManifest: null,
|
9
|
-
getEntrypointFiles: null
|
10
|
-
normalizeRewritesForBuildManifest: null,
|
11
|
-
processRoute: null,
|
12
|
-
srcEmptySsgManifest: null
|
8
|
+
getEntrypointFiles: null
|
13
9
|
});
|
14
10
|
function _export(target, all) {
|
15
11
|
for(var name in all)Object.defineProperty(target, name, {
|
@@ -18,9 +14,6 @@ function _export(target, all) {
|
|
18
14
|
});
|
19
15
|
}
|
20
16
|
_export(exports, {
|
21
|
-
createEdgeRuntimeManifest: function() {
|
22
|
-
return createEdgeRuntimeManifest;
|
23
|
-
},
|
24
17
|
// This plugin creates a build-manifest.json for all assets that are being output
|
25
18
|
// It has a mapping of "entry" filename to real filename. Because the real filename can be hashed in production
|
26
19
|
default: function() {
|
@@ -31,15 +24,6 @@ _export(exports, {
|
|
31
24
|
},
|
32
25
|
getEntrypointFiles: function() {
|
33
26
|
return getEntrypointFiles;
|
34
|
-
},
|
35
|
-
normalizeRewritesForBuildManifest: function() {
|
36
|
-
return normalizeRewritesForBuildManifest;
|
37
|
-
},
|
38
|
-
processRoute: function() {
|
39
|
-
return processRoute;
|
40
|
-
},
|
41
|
-
srcEmptySsgManifest: function() {
|
42
|
-
return srcEmptySsgManifest;
|
43
27
|
}
|
44
28
|
});
|
45
29
|
const _devalue = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/devalue"));
|
@@ -50,50 +34,16 @@ const _nextdropclientpageplugin = require("./next-drop-client-page-plugin");
|
|
50
34
|
const _utils = require("../../../shared/lib/router/utils");
|
51
35
|
const _trace = require("../../../trace");
|
52
36
|
const _utils1 = require("../utils");
|
37
|
+
const _buildmanifestpluginutils = require("./build-manifest-plugin-utils");
|
53
38
|
function _interop_require_default(obj) {
|
54
39
|
return obj && obj.__esModule ? obj : {
|
55
40
|
default: obj
|
56
41
|
};
|
57
42
|
}
|
58
|
-
const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`;
|
59
43
|
// nodejs: '/static/<build id>/low-priority.js'
|
60
44
|
function buildNodejsLowPriorityPath(filename, buildId) {
|
61
45
|
return `${_constants.CLIENT_STATIC_FILES_PATH}/${buildId}/${filename}`;
|
62
46
|
}
|
63
|
-
function createEdgeRuntimeManifest(originAssetMap) {
|
64
|
-
const manifestFilenames = [
|
65
|
-
'_buildManifest.js',
|
66
|
-
'_ssgManifest.js'
|
67
|
-
];
|
68
|
-
const assetMap = {
|
69
|
-
...originAssetMap,
|
70
|
-
lowPriorityFiles: []
|
71
|
-
};
|
72
|
-
// we use globalThis here because middleware can be node
|
73
|
-
// which doesn't have "self"
|
74
|
-
const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(assetMap, null, 2)};\n`;
|
75
|
-
// edge lowPriorityFiles item: '"/static/" + process.env.__NEXT_BUILD_ID + "/low-priority.js"'.
|
76
|
-
// Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.
|
77
|
-
const lowPriorityFilesCode = `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\n` + manifestFilenames.map((filename)=>{
|
78
|
-
return `"/static/" + process.env.__NEXT_BUILD_ID + "/${filename}",\n`;
|
79
|
-
}).join(',') + `\n];`;
|
80
|
-
return manifestDefCode + lowPriorityFilesCode;
|
81
|
-
}
|
82
|
-
function normalizeRewrite(item) {
|
83
|
-
return {
|
84
|
-
has: item.has,
|
85
|
-
source: item.source,
|
86
|
-
destination: item.destination
|
87
|
-
};
|
88
|
-
}
|
89
|
-
function normalizeRewritesForBuildManifest(rewrites) {
|
90
|
-
var _rewrites_afterFiles_map, _rewrites_afterFiles, _rewrites_beforeFiles_map, _rewrites_beforeFiles, _rewrites_fallback_map, _rewrites_fallback;
|
91
|
-
return {
|
92
|
-
afterFiles: (_rewrites_afterFiles = rewrites.afterFiles) == null ? void 0 : (_rewrites_afterFiles_map = _rewrites_afterFiles.map(processRoute)) == null ? void 0 : _rewrites_afterFiles_map.map((item)=>normalizeRewrite(item)),
|
93
|
-
beforeFiles: (_rewrites_beforeFiles = rewrites.beforeFiles) == null ? void 0 : (_rewrites_beforeFiles_map = _rewrites_beforeFiles.map(processRoute)) == null ? void 0 : _rewrites_beforeFiles_map.map((item)=>normalizeRewrite(item)),
|
94
|
-
fallback: (_rewrites_fallback = rewrites.fallback) == null ? void 0 : (_rewrites_fallback_map = _rewrites_fallback.map(processRoute)) == null ? void 0 : _rewrites_fallback_map.map((item)=>normalizeRewrite(item))
|
95
|
-
};
|
96
|
-
}
|
97
47
|
function generateClientManifest(assetMap, rewrites, clientRouterFilters, compiler, compilation) {
|
98
48
|
const compilationSpan = compilation ? (0, _utils1.getCompilationSpan)(compilation) : compiler ? (0, _utils1.getCompilationSpan)(compiler) : new _trace.Span({
|
99
49
|
name: 'client-manifest'
|
@@ -101,7 +51,7 @@ function generateClientManifest(assetMap, rewrites, clientRouterFilters, compile
|
|
101
51
|
const genClientManifestSpan = compilationSpan == null ? void 0 : compilationSpan.traceChild('NextJsBuildManifest-generateClientManifest');
|
102
52
|
return genClientManifestSpan == null ? void 0 : genClientManifestSpan.traceFn(()=>{
|
103
53
|
const clientManifest = {
|
104
|
-
__rewrites: normalizeRewritesForBuildManifest(rewrites),
|
54
|
+
__rewrites: (0, _buildmanifestpluginutils.normalizeRewritesForBuildManifest)(rewrites),
|
105
55
|
__routerFilterStatic: clientRouterFilters == null ? void 0 : clientRouterFilters.staticFilter,
|
106
56
|
__routerFilterDynamic: clientRouterFilters == null ? void 0 : clientRouterFilters.dynamicFilter
|
107
57
|
};
|
@@ -130,18 +80,6 @@ function getEntrypointFiles(entrypoint) {
|
|
130
80
|
return /(?<!\.hot-update)\.(js|css)($|\?)/.test(file);
|
131
81
|
}).map((file)=>file.replace(/\\/g, '/'))) ?? [];
|
132
82
|
}
|
133
|
-
const processRoute = (r)=>{
|
134
|
-
var _rewrite_destination;
|
135
|
-
const rewrite = {
|
136
|
-
...r
|
137
|
-
};
|
138
|
-
// omit external rewrite destinations since these aren't
|
139
|
-
// handled client-side
|
140
|
-
if (!(rewrite == null ? void 0 : (_rewrite_destination = rewrite.destination) == null ? void 0 : _rewrite_destination.startsWith('/'))) {
|
141
|
-
delete rewrite.destination;
|
142
|
-
}
|
143
|
-
return rewrite;
|
144
|
-
};
|
145
83
|
class BuildManifestPlugin {
|
146
84
|
constructor(options){
|
147
85
|
this.buildId = options.buildId;
|
@@ -153,9 +91,9 @@ class BuildManifestPlugin {
|
|
153
91
|
};
|
154
92
|
this.appDirEnabled = options.appDirEnabled;
|
155
93
|
this.clientRouterFilters = options.clientRouterFilters;
|
156
|
-
this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute);
|
157
|
-
this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute);
|
158
|
-
this.rewrites.fallback = options.rewrites.fallback.map(processRoute);
|
94
|
+
this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(_buildmanifestpluginutils.processRoute);
|
95
|
+
this.rewrites.afterFiles = options.rewrites.afterFiles.map(_buildmanifestpluginutils.processRoute);
|
96
|
+
this.rewrites.fallback = options.rewrites.fallback.map(_buildmanifestpluginutils.processRoute);
|
159
97
|
}
|
160
98
|
createAssets(compiler, compilation) {
|
161
99
|
const compilationSpan = (0, _utils1.getCompilationSpan)(compilation) ?? (0, _utils1.getCompilationSpan)(compiler);
|
@@ -228,7 +166,7 @@ class BuildManifestPlugin {
|
|
228
166
|
const buildManifestPath = buildNodejsLowPriorityPath('_buildManifest.js', this.buildId);
|
229
167
|
const ssgManifestPath = buildNodejsLowPriorityPath('_ssgManifest.js', this.buildId);
|
230
168
|
assetMap.lowPriorityFiles.push(buildManifestPath, ssgManifestPath);
|
231
|
-
compilation.emitAsset(ssgManifestPath, new _webpack.sources.RawSource(srcEmptySsgManifest));
|
169
|
+
compilation.emitAsset(ssgManifestPath, new _webpack.sources.RawSource(_buildmanifestpluginutils.srcEmptySsgManifest));
|
232
170
|
}
|
233
171
|
assetMap.pages = Object.keys(assetMap.pages).sort().reduce(// eslint-disable-next-line
|
234
172
|
(a, c)=>(a[c] = assetMap.pages[c], a), {});
|
@@ -237,7 +175,7 @@ class BuildManifestPlugin {
|
|
237
175
|
buildManifestName = `fallback-${_constants.BUILD_MANIFEST}`;
|
238
176
|
}
|
239
177
|
compilation.emitAsset(buildManifestName, new _webpack.sources.RawSource(JSON.stringify(assetMap, null, 2)));
|
240
|
-
compilation.emitAsset(`server/${_constants.MIDDLEWARE_BUILD_MANIFEST}.js`, new _webpack.sources.RawSource(`${createEdgeRuntimeManifest(assetMap)}`));
|
178
|
+
compilation.emitAsset(`server/${_constants.MIDDLEWARE_BUILD_MANIFEST}.js`, new _webpack.sources.RawSource(`${(0, _buildmanifestpluginutils.createEdgeRuntimeManifest)(assetMap)}`));
|
241
179
|
if (!this.isDevFallback) {
|
242
180
|
compilation.emitAsset(`${_constants.CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js`, new _webpack.sources.RawSource(`self.__BUILD_MANIFEST = ${generateClientManifest(assetMap, this.rewrites, this.clientRouterFilters, compiler, compilation)};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()`));
|
243
181
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/build/webpack/plugins/build-manifest-plugin.ts"],"sourcesContent":["import type { BloomFilter } from '../../../shared/lib/bloom-filter'\nimport type { Rewrite, CustomRoutes } from '../../../lib/load-custom-routes'\nimport devalue from 'next/dist/compiled/devalue'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n BUILD_MANIFEST,\n MIDDLEWARE_BUILD_MANIFEST,\n CLIENT_STATIC_FILES_PATH,\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_AMP,\n SYSTEM_ENTRYPOINTS,\n} from '../../../shared/lib/constants'\nimport type { BuildManifest } from '../../../server/get-page-files'\nimport getRouteFromEntrypoint from '../../../server/get-route-from-entrypoint'\nimport { ampFirstEntryNamesMap } from './next-drop-client-page-plugin'\nimport { getSortedRoutes } from '../../../shared/lib/router/utils'\nimport { Span } from '../../../trace'\nimport { getCompilationSpan } from '../utils'\n\ntype DeepMutable<T> = { -readonly [P in keyof T]: DeepMutable<T[P]> }\n\nexport type ClientBuildManifest = {\n [key: string]: string[]\n}\n\n// Add the runtime ssg manifest file as a lazy-loaded file dependency.\n// We also stub this file out for development mode (when it is not\n// generated).\nexport const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`\n\n// nodejs: '/static/<build id>/low-priority.js'\nfunction buildNodejsLowPriorityPath(filename: string, buildId: string) {\n return `${CLIENT_STATIC_FILES_PATH}/${buildId}/${filename}`\n}\n\nexport function createEdgeRuntimeManifest(\n originAssetMap: Partial<BuildManifest>\n): string {\n const manifestFilenames = ['_buildManifest.js', '_ssgManifest.js']\n\n const assetMap: Partial<BuildManifest> = {\n ...originAssetMap,\n lowPriorityFiles: [],\n }\n\n // we use globalThis here because middleware can be node\n // which doesn't have \"self\"\n const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(\n assetMap,\n null,\n 2\n )};\\n`\n // edge lowPriorityFiles item: '\"/static/\" + process.env.__NEXT_BUILD_ID + \"/low-priority.js\"'.\n // Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.\n const lowPriorityFilesCode =\n `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\\n` +\n manifestFilenames\n .map((filename) => {\n return `\"/static/\" + process.env.__NEXT_BUILD_ID + \"/${filename}\",\\n`\n })\n .join(',') +\n `\\n];`\n\n return manifestDefCode + lowPriorityFilesCode\n}\n\nfunction normalizeRewrite(item: {\n source: string\n destination: string\n has?: any\n}): CustomRoutes['rewrites']['beforeFiles'][0] {\n return {\n has: item.has,\n source: item.source,\n destination: item.destination,\n }\n}\n\nexport function normalizeRewritesForBuildManifest(\n rewrites: CustomRoutes['rewrites']\n): CustomRoutes['rewrites'] {\n return {\n afterFiles: rewrites.afterFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n beforeFiles: rewrites.beforeFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n fallback: rewrites.fallback\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n }\n}\n\n// This function takes the asset map generated in BuildManifestPlugin and creates a\n// reduced version to send to the client.\nexport function generateClientManifest(\n assetMap: BuildManifest,\n rewrites: CustomRoutes['rewrites'],\n clientRouterFilters?: {\n staticFilter: ReturnType<BloomFilter['export']>\n dynamicFilter: ReturnType<BloomFilter['export']>\n },\n compiler?: any,\n compilation?: any\n): string | undefined {\n const compilationSpan = compilation\n ? getCompilationSpan(compilation)\n : compiler\n ? getCompilationSpan(compiler)\n : new Span({ name: 'client-manifest' })\n\n const genClientManifestSpan = compilationSpan?.traceChild(\n 'NextJsBuildManifest-generateClientManifest'\n )\n\n return genClientManifestSpan?.traceFn(() => {\n const clientManifest: ClientBuildManifest = {\n __rewrites: normalizeRewritesForBuildManifest(rewrites) as any,\n __routerFilterStatic: clientRouterFilters?.staticFilter as any,\n __routerFilterDynamic: clientRouterFilters?.dynamicFilter as any,\n }\n const appDependencies = new Set(assetMap.pages['/_app'])\n const sortedPageKeys = getSortedRoutes(Object.keys(assetMap.pages))\n\n sortedPageKeys.forEach((page) => {\n const dependencies = assetMap.pages[page]\n\n if (page === '/_app') return\n // Filter out dependencies in the _app entry, because those will have already\n // been loaded by the client prior to a navigation event\n const filteredDeps = dependencies.filter(\n (dep) => !appDependencies.has(dep)\n )\n\n // The manifest can omit the page if it has no requirements\n if (filteredDeps.length) {\n clientManifest[page] = filteredDeps\n }\n })\n // provide the sorted pages as an array so we don't rely on the object's keys\n // being in order and we don't slow down look-up time for page assets\n clientManifest.sortedPages = sortedPageKeys\n\n return devalue(clientManifest)\n })\n}\n\nexport function getEntrypointFiles(entrypoint: any): string[] {\n return (\n entrypoint\n ?.getFiles()\n .filter((file: string) => {\n // We don't want to include `.hot-update.js` files into the initial page\n return /(?<!\\.hot-update)\\.(js|css)($|\\?)/.test(file)\n })\n .map((file: string) => file.replace(/\\\\/g, '/')) ?? []\n )\n}\n\nexport const processRoute = (r: Rewrite) => {\n const rewrite = { ...r }\n\n // omit external rewrite destinations since these aren't\n // handled client-side\n if (!rewrite?.destination?.startsWith('/')) {\n delete (rewrite as any).destination\n }\n return rewrite\n}\n\n// This plugin creates a build-manifest.json for all assets that are being output\n// It has a mapping of \"entry\" filename to real filename. Because the real filename can be hashed in production\nexport default class BuildManifestPlugin {\n private buildId: string\n private rewrites: CustomRoutes['rewrites']\n private isDevFallback: boolean\n private appDirEnabled: boolean\n private clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n\n constructor(options: {\n buildId: string\n rewrites: CustomRoutes['rewrites']\n isDevFallback?: boolean\n appDirEnabled: boolean\n clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n }) {\n this.buildId = options.buildId\n this.isDevFallback = !!options.isDevFallback\n this.rewrites = {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n }\n this.appDirEnabled = options.appDirEnabled\n this.clientRouterFilters = options.clientRouterFilters\n this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute)\n this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute)\n this.rewrites.fallback = options.rewrites.fallback.map(processRoute)\n }\n\n createAssets(compiler: any, compilation: any) {\n const compilationSpan =\n getCompilationSpan(compilation) ?? getCompilationSpan(compiler)\n if (!compilationSpan) {\n throw new Error('No span found for compilation')\n }\n\n const createAssetsSpan = compilationSpan.traceChild(\n 'NextJsBuildManifest-createassets'\n )\n\n return createAssetsSpan.traceFn(() => {\n const entrypoints: Map<string, any> = compilation.entrypoints\n const assetMap: DeepMutable<BuildManifest> = {\n polyfillFiles: [],\n devFiles: [],\n ampDevFiles: [],\n lowPriorityFiles: [],\n rootMainFiles: [],\n rootMainFilesTree: {},\n pages: { '/_app': [] },\n ampFirstPages: [],\n }\n\n const ampFirstEntryNames = ampFirstEntryNamesMap.get(compilation)\n if (ampFirstEntryNames) {\n for (const entryName of ampFirstEntryNames) {\n const pagePath = getRouteFromEntrypoint(entryName)\n if (!pagePath) {\n continue\n }\n\n assetMap.ampFirstPages.push(pagePath)\n }\n }\n\n const mainFiles = new Set(\n getEntrypointFiles(entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN))\n )\n\n if (this.appDirEnabled) {\n assetMap.rootMainFiles = [\n ...new Set(\n getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN_APP)\n )\n ),\n ]\n }\n\n const compilationAssets: {\n name: string\n source: typeof sources.RawSource\n info: object\n }[] = compilation.getAssets()\n\n assetMap.polyfillFiles = compilationAssets\n .filter((p) => {\n // Ensure only .js files are passed through\n if (!p.name.endsWith('.js')) {\n return false\n }\n\n return (\n p.info && CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL in p.info\n )\n })\n .map((v) => v.name)\n\n assetMap.devFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH)\n ).filter((file) => !mainFiles.has(file))\n\n assetMap.ampDevFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_AMP)\n )\n\n for (const entrypoint of compilation.entrypoints.values()) {\n if (SYSTEM_ENTRYPOINTS.has(entrypoint.name)) continue\n const pagePath = getRouteFromEntrypoint(entrypoint.name)\n\n if (!pagePath) {\n continue\n }\n\n const filesForPage = getEntrypointFiles(entrypoint)\n\n assetMap.pages[pagePath] = [...new Set([...mainFiles, ...filesForPage])]\n }\n\n if (!this.isDevFallback) {\n // Add the runtime build manifest file (generated later in this file)\n // as a dependency for the app. If the flag is false, the file won't be\n // downloaded by the client.\n const buildManifestPath = buildNodejsLowPriorityPath(\n '_buildManifest.js',\n this.buildId\n )\n const ssgManifestPath = buildNodejsLowPriorityPath(\n '_ssgManifest.js',\n this.buildId\n )\n assetMap.lowPriorityFiles.push(buildManifestPath, ssgManifestPath)\n compilation.emitAsset(\n ssgManifestPath,\n new sources.RawSource(srcEmptySsgManifest)\n )\n }\n\n assetMap.pages = Object.keys(assetMap.pages)\n .sort()\n .reduce(\n // eslint-disable-next-line\n (a, c) => ((a[c] = assetMap.pages[c]), a),\n {} as typeof assetMap.pages\n )\n\n let buildManifestName = BUILD_MANIFEST\n\n if (this.isDevFallback) {\n buildManifestName = `fallback-${BUILD_MANIFEST}`\n }\n\n compilation.emitAsset(\n buildManifestName,\n new sources.RawSource(JSON.stringify(assetMap, null, 2))\n )\n\n compilation.emitAsset(\n `server/${MIDDLEWARE_BUILD_MANIFEST}.js`,\n new sources.RawSource(`${createEdgeRuntimeManifest(assetMap)}`)\n )\n\n if (!this.isDevFallback) {\n compilation.emitAsset(\n `${CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js`,\n new sources.RawSource(\n `self.__BUILD_MANIFEST = ${generateClientManifest(\n assetMap,\n this.rewrites,\n this.clientRouterFilters,\n compiler,\n compilation\n )};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()`\n )\n )\n }\n })\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.make.tap('NextJsBuildManifest', (compilation: any) => {\n compilation.hooks.processAssets.tap(\n {\n name: 'NextJsBuildManifest',\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n () => {\n this.createAssets(compiler, compilation)\n }\n )\n })\n return\n }\n}\n"],"names":["createEdgeRuntimeManifest","BuildManifestPlugin","generateClientManifest","getEntrypointFiles","normalizeRewritesForBuildManifest","processRoute","srcEmptySsgManifest","buildNodejsLowPriorityPath","filename","buildId","CLIENT_STATIC_FILES_PATH","originAssetMap","manifestFilenames","assetMap","lowPriorityFiles","manifestDefCode","JSON","stringify","lowPriorityFilesCode","map","join","normalizeRewrite","item","has","source","destination","rewrites","afterFiles","beforeFiles","fallback","clientRouterFilters","compiler","compilation","compilationSpan","getCompilationSpan","Span","name","genClientManifestSpan","traceChild","traceFn","clientManifest","__rewrites","__routerFilterStatic","staticFilter","__routerFilterDynamic","dynamicFilter","appDependencies","Set","pages","sortedPageKeys","getSortedRoutes","Object","keys","forEach","page","dependencies","filteredDeps","filter","dep","length","sortedPages","devalue","entrypoint","getFiles","file","test","replace","r","rewrite","startsWith","constructor","options","isDevFallback","appDirEnabled","createAssets","Error","createAssetsSpan","entrypoints","polyfillFiles","devFiles","ampDevFiles","rootMainFiles","rootMainFilesTree","ampFirstPages","ampFirstEntryNames","ampFirstEntryNamesMap","get","entryName","pagePath","getRouteFromEntrypoint","push","mainFiles","CLIENT_STATIC_FILES_RUNTIME_MAIN","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","compilationAssets","getAssets","p","endsWith","info","CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL","v","CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH","CLIENT_STATIC_FILES_RUNTIME_AMP","values","SYSTEM_ENTRYPOINTS","filesForPage","buildManifestPath","ssgManifestPath","emitAsset","sources","RawSource","sort","reduce","a","c","buildManifestName","BUILD_MANIFEST","MIDDLEWARE_BUILD_MANIFEST","apply","hooks","make","tap","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STA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AC,CAACC,EAAE,GAAGrG,SAASmC,KAAK,CAACkE,EAAE,EAAGD,CAAAA,GACvC,CAAC;YAGL,IAAIE,oBAAoBC,yBAAc;YAEtC,IAAI,IAAI,CAAC5C,aAAa,EAAE;gBACtB2C,oBAAoB,CAAC,SAAS,EAAEC,yBAAc,EAAE;YAClD;YAEApF,YAAY4E,SAAS,CACnBO,mBACA,IAAIN,gBAAO,CAACC,SAAS,CAAC9F,KAAKC,SAAS,CAACJ,UAAU,MAAM;YAGvDmB,YAAY4E,SAAS,CACnB,CAAC,OAAO,EAAES,oCAAyB,CAAC,GAAG,CAAC,EACxC,IAAIR,gBAAO,CAACC,SAAS,CAAC,GAAG9G,0BAA0Ba,WAAW;YAGhE,IAAI,CAAC,IAAI,CAAC2D,aAAa,EAAE;gBACvBxC,YAAY4E,SAAS,CACnB,GAAGlG,mCAAwB,CAAC,CAAC,EAAE,IAAI,CAACD,OAAO,CAAC,kBAAkB,CAAC,EAC/D,IAAIoG,gBAAO,CAACC,SAAS,CACnB,CAAC,wBAAwB,EAAE5G,uBACzBW,UACA,IAAI,CAACa,QAAQ,EACb,IAAI,CAACI,mBAAmB,EACxBC,UACAC,aACA,uDAAuD,CAAC;YAGhE;QACF;IACF;IAEAsF,MAAMvF,QAA0B,EAAE;QAChCA,SAASwF,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,uBAAuB,CAACzF;YAC9CA,YAAYuF,KAAK,CAACG,aAAa,CAACD,GAAG,CACjC;gBACErF,MAAM;gBACNuF,OAAOC,gBAAO,CAACC,WAAW,CAACC,8BAA8B;YAC3D,GACA;gBACE,IAAI,CAACpD,YAAY,CAAC3C,UAAUC;YAC9B;QAEJ;QACA;IACF;AACF","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../../src/build/webpack/plugins/build-manifest-plugin.ts"],"sourcesContent":["import type { BloomFilter } from '../../../shared/lib/bloom-filter'\nimport type { CustomRoutes } from '../../../lib/load-custom-routes'\nimport devalue from 'next/dist/compiled/devalue'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n BUILD_MANIFEST,\n MIDDLEWARE_BUILD_MANIFEST,\n CLIENT_STATIC_FILES_PATH,\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_AMP,\n SYSTEM_ENTRYPOINTS,\n} from '../../../shared/lib/constants'\nimport type { BuildManifest } from '../../../server/get-page-files'\nimport getRouteFromEntrypoint from '../../../server/get-route-from-entrypoint'\nimport { ampFirstEntryNamesMap } from './next-drop-client-page-plugin'\nimport { getSortedRoutes } from '../../../shared/lib/router/utils'\nimport { Span } from '../../../trace'\nimport { getCompilationSpan } from '../utils'\nimport {\n createEdgeRuntimeManifest,\n normalizeRewritesForBuildManifest,\n processRoute,\n srcEmptySsgManifest,\n type ClientBuildManifest,\n} from './build-manifest-plugin-utils'\n\ntype DeepMutable<T> = { -readonly [P in keyof T]: DeepMutable<T[P]> }\n\n// nodejs: '/static/<build id>/low-priority.js'\nfunction buildNodejsLowPriorityPath(filename: string, buildId: string) {\n return `${CLIENT_STATIC_FILES_PATH}/${buildId}/${filename}`\n}\n\n// This function takes the asset map generated in BuildManifestPlugin and creates a\n// reduced version to send to the client.\nexport function generateClientManifest(\n assetMap: BuildManifest,\n rewrites: CustomRoutes['rewrites'],\n clientRouterFilters?: {\n staticFilter: ReturnType<BloomFilter['export']>\n dynamicFilter: ReturnType<BloomFilter['export']>\n },\n compiler?: any,\n compilation?: any\n): string | undefined {\n const compilationSpan = compilation\n ? getCompilationSpan(compilation)\n : compiler\n ? getCompilationSpan(compiler)\n : new Span({ name: 'client-manifest' })\n\n const genClientManifestSpan = compilationSpan?.traceChild(\n 'NextJsBuildManifest-generateClientManifest'\n )\n\n return genClientManifestSpan?.traceFn(() => {\n const clientManifest: ClientBuildManifest = {\n __rewrites: normalizeRewritesForBuildManifest(rewrites) as any,\n __routerFilterStatic: clientRouterFilters?.staticFilter as any,\n __routerFilterDynamic: clientRouterFilters?.dynamicFilter as any,\n }\n const appDependencies = new Set(assetMap.pages['/_app'])\n const sortedPageKeys = getSortedRoutes(Object.keys(assetMap.pages))\n\n sortedPageKeys.forEach((page) => {\n const dependencies = assetMap.pages[page]\n\n if (page === '/_app') return\n // Filter out dependencies in the _app entry, because those will have already\n // been loaded by the client prior to a navigation event\n const filteredDeps = dependencies.filter(\n (dep) => !appDependencies.has(dep)\n )\n\n // The manifest can omit the page if it has no requirements\n if (filteredDeps.length) {\n clientManifest[page] = filteredDeps\n }\n })\n // provide the sorted pages as an array so we don't rely on the object's keys\n // being in order and we don't slow down look-up time for page assets\n clientManifest.sortedPages = sortedPageKeys\n\n return devalue(clientManifest)\n })\n}\n\nexport function getEntrypointFiles(entrypoint: any): string[] {\n return (\n entrypoint\n ?.getFiles()\n .filter((file: string) => {\n // We don't want to include `.hot-update.js` files into the initial page\n return /(?<!\\.hot-update)\\.(js|css)($|\\?)/.test(file)\n })\n .map((file: string) => file.replace(/\\\\/g, '/')) ?? []\n )\n}\n\n// This plugin creates a build-manifest.json for all assets that are being output\n// It has a mapping of \"entry\" filename to real filename. Because the real filename can be hashed in production\nexport default class BuildManifestPlugin {\n private buildId: string\n private rewrites: CustomRoutes['rewrites']\n private isDevFallback: boolean\n private appDirEnabled: boolean\n private clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n\n constructor(options: {\n buildId: string\n rewrites: CustomRoutes['rewrites']\n isDevFallback?: boolean\n appDirEnabled: boolean\n clientRouterFilters?: Parameters<typeof generateClientManifest>[2]\n }) {\n this.buildId = options.buildId\n this.isDevFallback = !!options.isDevFallback\n this.rewrites = {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n }\n this.appDirEnabled = options.appDirEnabled\n this.clientRouterFilters = options.clientRouterFilters\n this.rewrites.beforeFiles = options.rewrites.beforeFiles.map(processRoute)\n this.rewrites.afterFiles = options.rewrites.afterFiles.map(processRoute)\n this.rewrites.fallback = options.rewrites.fallback.map(processRoute)\n }\n\n createAssets(compiler: any, compilation: any) {\n const compilationSpan =\n getCompilationSpan(compilation) ?? getCompilationSpan(compiler)\n if (!compilationSpan) {\n throw new Error('No span found for compilation')\n }\n\n const createAssetsSpan = compilationSpan.traceChild(\n 'NextJsBuildManifest-createassets'\n )\n\n return createAssetsSpan.traceFn(() => {\n const entrypoints: Map<string, any> = compilation.entrypoints\n const assetMap: DeepMutable<BuildManifest> = {\n polyfillFiles: [],\n devFiles: [],\n ampDevFiles: [],\n lowPriorityFiles: [],\n rootMainFiles: [],\n rootMainFilesTree: {},\n pages: { '/_app': [] },\n ampFirstPages: [],\n }\n\n const ampFirstEntryNames = ampFirstEntryNamesMap.get(compilation)\n if (ampFirstEntryNames) {\n for (const entryName of ampFirstEntryNames) {\n const pagePath = getRouteFromEntrypoint(entryName)\n if (!pagePath) {\n continue\n }\n\n assetMap.ampFirstPages.push(pagePath)\n }\n }\n\n const mainFiles = new Set(\n getEntrypointFiles(entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN))\n )\n\n if (this.appDirEnabled) {\n assetMap.rootMainFiles = [\n ...new Set(\n getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_MAIN_APP)\n )\n ),\n ]\n }\n\n const compilationAssets: {\n name: string\n source: typeof sources.RawSource\n info: object\n }[] = compilation.getAssets()\n\n assetMap.polyfillFiles = compilationAssets\n .filter((p) => {\n // Ensure only .js files are passed through\n if (!p.name.endsWith('.js')) {\n return false\n }\n\n return (\n p.info && CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL in p.info\n )\n })\n .map((v) => v.name)\n\n assetMap.devFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH)\n ).filter((file) => !mainFiles.has(file))\n\n assetMap.ampDevFiles = getEntrypointFiles(\n entrypoints.get(CLIENT_STATIC_FILES_RUNTIME_AMP)\n )\n\n for (const entrypoint of compilation.entrypoints.values()) {\n if (SYSTEM_ENTRYPOINTS.has(entrypoint.name)) continue\n const pagePath = getRouteFromEntrypoint(entrypoint.name)\n\n if (!pagePath) {\n continue\n }\n\n const filesForPage = getEntrypointFiles(entrypoint)\n\n assetMap.pages[pagePath] = [...new Set([...mainFiles, ...filesForPage])]\n }\n\n if (!this.isDevFallback) {\n // Add the runtime build manifest file (generated later in this file)\n // as a dependency for the app. If the flag is false, the file won't be\n // downloaded by the client.\n const buildManifestPath = buildNodejsLowPriorityPath(\n '_buildManifest.js',\n this.buildId\n )\n const ssgManifestPath = buildNodejsLowPriorityPath(\n '_ssgManifest.js',\n this.buildId\n )\n assetMap.lowPriorityFiles.push(buildManifestPath, ssgManifestPath)\n compilation.emitAsset(\n ssgManifestPath,\n new sources.RawSource(srcEmptySsgManifest)\n )\n }\n\n assetMap.pages = Object.keys(assetMap.pages)\n .sort()\n .reduce(\n // eslint-disable-next-line\n (a, c) => ((a[c] = assetMap.pages[c]), a),\n {} as typeof assetMap.pages\n )\n\n let buildManifestName = BUILD_MANIFEST\n\n if (this.isDevFallback) {\n buildManifestName = `fallback-${BUILD_MANIFEST}`\n }\n\n compilation.emitAsset(\n buildManifestName,\n new sources.RawSource(JSON.stringify(assetMap, null, 2))\n )\n\n compilation.emitAsset(\n `server/${MIDDLEWARE_BUILD_MANIFEST}.js`,\n new sources.RawSource(`${createEdgeRuntimeManifest(assetMap)}`)\n )\n\n if (!this.isDevFallback) {\n compilation.emitAsset(\n `${CLIENT_STATIC_FILES_PATH}/${this.buildId}/_buildManifest.js`,\n new sources.RawSource(\n `self.__BUILD_MANIFEST = ${generateClientManifest(\n assetMap,\n this.rewrites,\n this.clientRouterFilters,\n compiler,\n compilation\n )};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()`\n )\n )\n }\n })\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.make.tap('NextJsBuildManifest', (compilation: any) => {\n compilation.hooks.processAssets.tap(\n {\n name: 'NextJsBuildManifest',\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n () => {\n this.createAssets(compiler, compilation)\n }\n )\n })\n return\n }\n}\n"],"names":["BuildManifestPlugin","generateClientManifest","getEntrypointFiles","buildNodejsLowPriorityPath","filename","buildId","CLIENT_STATIC_FILES_PATH","assetMap","rewrites","clientRouterFilters","compiler","compilation","compilationSpan","getCompilationSpan","Span","name","genClientManifestSpan","traceChild","traceFn","clientManifest","__rewrites","normalizeRewritesForBuildManifest","__routerFilterStatic","staticFilter","__routerFilterDynamic","dynamicFilter","appDependencies","Set","pages","sortedPageKeys","getSortedRoutes","Object","keys","forEach","page","dependencies","filteredDeps","filter","dep","has","length","sortedPages","devalue","entrypoint","getFiles","file","test","map","replace","constructor","options","isDevFallback","beforeFiles","afterFiles","fallback","appDirEnabled","processRoute","createAssets","Error","createAssetsSpan","entrypoints","polyfillFiles","devFiles","ampDevFiles","lowPriorityFiles","rootMainFiles","rootMainFilesTree","ampFirstPages","ampFirstEntryNames","ampFirstEntryNamesMap","get","entryName","pagePath","getRouteFromEntrypoint","push","mainFiles","CLIENT_STATIC_FILES_RUNTIME_MAIN","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","compilationAssets","getAssets","p","endsWith","info","CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL","v","CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH","CLIENT_STATIC_FILES_RUNTIME_AMP","values","SYSTEM_ENTRYPOINTS","filesForPage","buildManifestPath","ssgManifestPath","emitAsset","sources","RawSource","srcEmptySsgManifest","sort","reduce","a","c","buildManifestName","BUILD_MANIFEST","JSON","stringify","MIDDLEWARE_BUILD_MANIFEST","createEdgeRuntimeManifest","apply","hooks","make","tap","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_ADDITIONS"],"mappings":";;;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AACQ,KAAKC,SAAS,CAAChG,UAAU,MAAM;YAGvDI,YAAYiF,SAAS,CACnB,CAAC,OAAO,EAAEY,oCAAyB,CAAC,GAAG,CAAC,EACxC,IAAIX,gBAAO,CAACC,SAAS,CAAC,GAAGW,IAAAA,mDAAyB,EAAClG,WAAW;YAGhE,IAAI,CAAC,IAAI,CAAC4C,aAAa,EAAE;gBACvBxC,YAAYiF,SAAS,CACnB,GAAGtF,mCAAwB,CAAC,CAAC,EAAE,IAAI,CAACD,OAAO,CAAC,kBAAkB,CAAC,EAC/D,IAAIwF,gBAAO,CAACC,SAAS,CACnB,CAAC,wBAAwB,EAAE7F,uBACzBM,UACA,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,mBAAmB,EACxBC,UACAC,aACA,uDAAuD,CAAC;YAGhE;QACF;IACF;IAEA+F,MAAMhG,QAA0B,EAAE;QAChCA,SAASiG,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,uBAAuB,CAAClG;YAC9CA,YAAYgG,KAAK,CAACG,aAAa,CAACD,GAAG,CACjC;gBACE9F,MAAM;gBACNgG,OAAOC,gBAAO,CAACC,WAAW,CAACC,8BAA8B;YAC3D,GACA;gBACE,IAAI,CAACzD,YAAY,CAAC/C,UAAUC;YAC9B;QAEJ;QACA;IACF;AACF","ignoreList":[0]}
|
@@ -1706,7 +1706,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1706
1706
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
1707
1707
|
// file path to build output of `@next/polyfill-nomodule`
|
1708
1708
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1709
|
-
cacheKey: "15.6.0-canary.
|
1709
|
+
cacheKey: "15.6.0-canary.23",
|
1710
1710
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1711
1711
|
minimize: false,
|
1712
1712
|
info: {
|
@@ -1889,7 +1889,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1889
1889
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1890
1890
|
// - Next.js version
|
1891
1891
|
// - next.config.js keys that affect compilation
|
1892
|
-
version: `${__dirname}|${"15.6.0-canary.
|
1892
|
+
version: `${__dirname}|${"15.6.0-canary.23"}|${configVars}`,
|
1893
1893
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
1894
1894
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1895
1895
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "appBootstrap", {
|
|
15
15
|
});
|
16
16
|
const _assetprefix = require("./asset-prefix");
|
17
17
|
const _setattributesfromprops = require("./set-attributes-from-props");
|
18
|
-
const version = "15.6.0-canary.
|
18
|
+
const version = "15.6.0-canary.23";
|
19
19
|
window.next = {
|
20
20
|
version,
|
21
21
|
appDir: true
|
package/dist/client/index.js
CHANGED
@@ -60,7 +60,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
60
60
|
const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
|
61
61
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
62
62
|
const _isnextroutererror = require("./components/is-next-router-error");
|
63
|
-
const version = "15.6.0-canary.
|
63
|
+
const version = "15.6.0-canary.23";
|
64
64
|
let router;
|
65
65
|
const emitter = (0, _mitt.default)();
|
66
66
|
const looseToArray = (input)=>[].slice.call(input);
|
@@ -2,43 +2,40 @@ exports.__esModule = true
|
|
2
2
|
|
3
3
|
exports.default = undefined
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
} else {
|
40
|
-
Object.assign(exports, require('./bundle5')())
|
41
|
-
}
|
5
|
+
if (process.env.NEXT_RSPACK) {
|
6
|
+
// eslint-disable-next-line
|
7
|
+
Object.assign(exports, getRspackCore())
|
8
|
+
Object.assign(exports, {
|
9
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
10
|
+
StringXor: require('./bundle5')().StringXor,
|
11
|
+
})
|
12
|
+
} else if (process.env.NEXT_PRIVATE_LOCAL_WEBPACK) {
|
13
|
+
Object.assign(exports, {
|
14
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
15
|
+
BasicEvaluatedExpression: require('webpack/lib/javascript/BasicEvaluatedExpression'),
|
16
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
17
|
+
ConcatenatedModule: require('webpack/lib/optimize/ConcatenatedModule'),
|
18
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
19
|
+
makePathsAbsolute: require('webpack/lib/util/identifier').makePathsAbsolute,
|
20
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
21
|
+
ModuleFilenameHelpers: require('webpack/lib/ModuleFilenameHelpers'),
|
22
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
23
|
+
NodeTargetPlugin: require('webpack/lib/node/NodeTargetPlugin'),
|
24
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
25
|
+
RuntimeGlobals: require('webpack/lib/RuntimeGlobals'),
|
26
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
27
|
+
SourceMapDevToolModuleOptionsPlugin: require('webpack/lib/SourceMapDevToolModuleOptionsPlugin'),
|
28
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
29
|
+
StringXor: require('webpack/lib/util/StringXor'),
|
30
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
31
|
+
NormalModule: require('webpack/lib/NormalModule'),
|
32
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
33
|
+
sources: require('webpack').sources,
|
34
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
35
|
+
webpack: require('webpack'),
|
36
|
+
})
|
37
|
+
} else {
|
38
|
+
Object.assign(exports, require('./bundle5')())
|
42
39
|
}
|
43
40
|
|
44
41
|
function getRspackCore() {
|
package/dist/esm/build/index.js
CHANGED
@@ -303,7 +303,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
303
303
|
const nextBuildSpan = trace('next-build', undefined, {
|
304
304
|
buildMode: experimentalBuildMode,
|
305
305
|
isTurboBuild: String(isTurbopack),
|
306
|
-
version: "15.6.0-canary.
|
306
|
+
version: "15.6.0-canary.23"
|
307
307
|
});
|
308
308
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
309
309
|
NextBuildContext.dir = dir;
|
@@ -782,7 +782,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
782
782
|
// Files outside of the distDir can be "type": "module"
|
783
783
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
784
784
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
785
|
-
await recordFrameworkVersion("15.6.0-canary.
|
785
|
+
await recordFrameworkVersion("15.6.0-canary.23");
|
786
786
|
await updateBuildDiagnostics({
|
787
787
|
buildStage: 'start'
|
788
788
|
});
|
@@ -2431,7 +2431,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
2431
2431
|
distDir,
|
2432
2432
|
config,
|
2433
2433
|
staticPages,
|
2434
|
-
nextVersion: "15.6.0-canary.
|
2434
|
+
nextVersion: "15.6.0-canary.23",
|
2435
2435
|
tracingRoot: outputFileTracingRoot,
|
2436
2436
|
hasNodeMiddleware,
|
2437
2437
|
hasInstrumentationHook,
|
@@ -10,7 +10,7 @@ import { downloadNativeNextSwc, downloadWasmSwc } from '../../lib/download-swc';
|
|
10
10
|
import { isDeepStrictEqual } from 'util';
|
11
11
|
import { getDefineEnv } from '../define-env';
|
12
12
|
import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
|
13
|
-
const nextVersion = "15.6.0-canary.
|
13
|
+
const nextVersion = "15.6.0-canary.23";
|
14
14
|
const ArchName = arch();
|
15
15
|
const PlatformName = platform();
|
16
16
|
function infoLog(...args) {
|