next 15.2.0-canary.50 → 15.2.0-canary.52
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/load-jsconfig.d.ts +1 -0
- package/dist/build/load-jsconfig.js +2 -1
- package/dist/build/load-jsconfig.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.d.ts +3 -1
- package/dist/build/webpack-config.js +44 -23
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/errors/attach-hydration-error-state.js +37 -24
- package/dist/client/components/errors/attach-hydration-error-state.js.map +1 -1
- package/dist/client/components/errors/hydration-error-info.js +86 -19
- package/dist/client/components/errors/hydration-error-info.js.map +1 -1
- package/dist/client/components/is-hydration-error.d.ts +1 -0
- package/dist/client/components/is-hydration-error.js +41 -3
- package/dist/client/components/is-hydration-error.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js +1 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.d.ts +1 -56
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +4 -240
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js +0 -21
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.d.ts +54 -0
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js +101 -0
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -0
- package/dist/client/components/react-dev-overlay/internal/container/Errors.js +1 -2
- package/dist/client/components/react-dev-overlay/internal/container/Errors.js.map +1 -1
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.d.ts +2 -56
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js +28 -227
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js.map +1 -1
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/index.js +1 -1
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/index.js.map +1 -1
- package/dist/client/components/react-dev-overlay/internal/styles/ComponentStyles.js +3 -1
- package/dist/client/components/react-dev-overlay/internal/styles/ComponentStyles.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +6 -6
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/load-jsconfig.js +2 -1
- package/dist/esm/build/load-jsconfig.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +44 -23
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/errors/attach-hydration-error-state.js +38 -25
- package/dist/esm/client/components/errors/attach-hydration-error-state.js.map +1 -1
- package/dist/esm/client/components/errors/hydration-error-info.js +87 -20
- package/dist/esm/client/components/errors/hydration-error-info.js.map +1 -1
- package/dist/esm/client/components/is-hydration-error.js +36 -2
- package/dist/esm/client/components/is-hydration-error.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js +1 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +3 -287
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js +0 -21
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js +132 -0
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/internal/container/Errors.js +1 -2
- package/dist/esm/client/components/react-dev-overlay/internal/container/Errors.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js +12 -271
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/index.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/index.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/styles/ComponentStyles.js +3 -1
- package/dist/esm/client/components/react-dev-overlay/internal/styles/ComponentStyles.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/metadata/metadata.js +2 -2
- package/dist/esm/lib/metadata/metadata.js.map +1 -1
- package/dist/esm/server/config.js +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/start-server.js +1 -1
- package/dist/lib/metadata/metadata.js +2 -2
- package/dist/lib/metadata/metadata.js.map +1 -1
- package/dist/server/config.js +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/start-server.js +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
|
@@ -75,7 +75,7 @@ const program = new NextRootCommand();
|
|
|
75
75
|
program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
|
|
76
76
|
formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
|
|
77
77
|
subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
|
|
78
|
-
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.2.0-canary.
|
|
78
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.2.0-canary.52"}`, '-v, --version', 'Outputs the Next.js version.');
|
|
79
79
|
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('--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.').addOption(new _commander.Option('--experimental-turbo').hideHelp()).addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
|
|
80
80
|
'compile',
|
|
81
81
|
'generate'
|
package/dist/build/index.js
CHANGED
|
@@ -364,7 +364,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
364
364
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
|
365
365
|
buildMode: experimentalBuildMode,
|
|
366
366
|
isTurboBuild: String(turboNextBuild),
|
|
367
|
-
version: "15.2.0-canary.
|
|
367
|
+
version: "15.2.0-canary.52"
|
|
368
368
|
});
|
|
369
369
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
370
370
|
_buildcontext.NextBuildContext.dir = dir;
|
|
@@ -729,7 +729,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
729
729
|
// Files outside of the distDir can be "type": "module"
|
|
730
730
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
|
731
731
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
|
732
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.2.0-canary.
|
|
732
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.2.0-canary.52");
|
|
733
733
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
|
734
734
|
buildStage: 'start'
|
|
735
735
|
});
|
|
@@ -152,7 +152,8 @@ async function loadJsConfig(dir, config) {
|
|
|
152
152
|
return {
|
|
153
153
|
useTypeScript,
|
|
154
154
|
jsConfig,
|
|
155
|
-
resolvedBaseUrl
|
|
155
|
+
resolvedBaseUrl,
|
|
156
|
+
jsConfigPath: useTypeScript ? tsConfigPath : _fs.default.existsSync(jsConfigPath) ? jsConfigPath : undefined
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
159
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/build/load-jsconfig.ts"],"sourcesContent":["import path from 'path'\nimport fs from 'fs'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport * as Log from './output/log'\nimport { getTypeScriptConfiguration } from '../lib/typescript/getTypeScriptConfiguration'\nimport { readFileSync } from 'fs'\nimport isError from '../lib/is-error'\nimport { hasNecessaryDependencies } from '../lib/has-necessary-dependencies'\n\nlet TSCONFIG_WARNED = false\n\nexport function parseJsonFile(filePath: string) {\n const JSON5 = require('next/dist/compiled/json5')\n const contents = readFileSync(filePath, 'utf8')\n\n // Special case an empty file\n if (contents.trim() === '') {\n return {}\n }\n\n try {\n return JSON5.parse(contents)\n } catch (err) {\n if (!isError(err)) throw err\n const { codeFrameColumns } = require('next/dist/compiled/babel/code-frame')\n const codeFrame = codeFrameColumns(\n String(contents),\n {\n start: {\n line: (err as Error & { lineNumber?: number }).lineNumber || 0,\n column: (err as Error & { columnNumber?: number }).columnNumber || 0,\n },\n },\n { message: err.message, highlightCode: true }\n )\n throw new Error(`Failed to parse \"${filePath}\":\\n${codeFrame}`)\n }\n}\n\nexport type ResolvedBaseUrl =\n | { baseUrl: string; isImplicit: boolean }\n | undefined\n\nexport type JsConfig = { compilerOptions: Record<string, any> } | undefined\n\nexport default async function loadJsConfig(\n dir: string,\n config: NextConfigComplete\n): Promise<{\n useTypeScript: boolean\n jsConfig: JsConfig\n resolvedBaseUrl: ResolvedBaseUrl\n}> {\n let typeScriptPath: string | undefined\n try {\n const deps = await hasNecessaryDependencies(dir, [\n {\n pkg: 'typescript',\n file: 'typescript/lib/typescript.js',\n exportsRestrict: true,\n },\n ])\n typeScriptPath = deps.resolved.get('typescript')\n } catch {}\n const tsConfigPath = path.join(dir, config.typescript.tsconfigPath)\n const useTypeScript = Boolean(typeScriptPath && fs.existsSync(tsConfigPath))\n\n let implicitBaseurl\n let jsConfig: { compilerOptions: Record<string, any> } | undefined\n // jsconfig is a subset of tsconfig\n if (useTypeScript) {\n if (\n config.typescript.tsconfigPath !== 'tsconfig.json' &&\n TSCONFIG_WARNED === false\n ) {\n TSCONFIG_WARNED = true\n Log.info(`Using tsconfig file: ${config.typescript.tsconfigPath}`)\n }\n\n const ts = (await Promise.resolve(\n require(typeScriptPath!)\n )) as typeof import('typescript')\n const tsConfig = await getTypeScriptConfiguration(ts, tsConfigPath, true)\n jsConfig = { compilerOptions: tsConfig.options }\n implicitBaseurl = path.dirname(tsConfigPath)\n }\n\n const jsConfigPath = path.join(dir, 'jsconfig.json')\n if (!useTypeScript && fs.existsSync(jsConfigPath)) {\n jsConfig = parseJsonFile(jsConfigPath)\n implicitBaseurl = path.dirname(jsConfigPath)\n }\n\n let resolvedBaseUrl: ResolvedBaseUrl\n if (jsConfig?.compilerOptions?.baseUrl) {\n resolvedBaseUrl = {\n baseUrl: path.resolve(dir, jsConfig.compilerOptions.baseUrl),\n isImplicit: false,\n }\n } else {\n if (implicitBaseurl) {\n resolvedBaseUrl = {\n baseUrl: implicitBaseurl,\n isImplicit: true,\n }\n }\n }\n\n return {\n useTypeScript,\n jsConfig,\n resolvedBaseUrl,\n }\n}\n"],"names":["loadJsConfig","parseJsonFile","TSCONFIG_WARNED","filePath","JSON5","require","contents","readFileSync","trim","parse","err","isError","codeFrameColumns","codeFrame","String","start","line","lineNumber","column","columnNumber","message","highlightCode","Error","dir","config","jsConfig","typeScriptPath","deps","hasNecessaryDependencies","pkg","file","exportsRestrict","resolved","get","tsConfigPath","path","join","typescript","tsconfigPath","useTypeScript","Boolean","fs","existsSync","implicitBaseurl","Log","info","ts","Promise","resolve","tsConfig","getTypeScriptConfiguration","compilerOptions","options","dirname","jsConfigPath","resolvedBaseUrl","baseUrl","isImplicit"],"mappings":";;;;;;;;;;;;;;;IA6CA,
|
|
1
|
+
{"version":3,"sources":["../../src/build/load-jsconfig.ts"],"sourcesContent":["import path from 'path'\nimport fs from 'fs'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport * as Log from './output/log'\nimport { getTypeScriptConfiguration } from '../lib/typescript/getTypeScriptConfiguration'\nimport { readFileSync } from 'fs'\nimport isError from '../lib/is-error'\nimport { hasNecessaryDependencies } from '../lib/has-necessary-dependencies'\n\nlet TSCONFIG_WARNED = false\n\nexport function parseJsonFile(filePath: string) {\n const JSON5 = require('next/dist/compiled/json5')\n const contents = readFileSync(filePath, 'utf8')\n\n // Special case an empty file\n if (contents.trim() === '') {\n return {}\n }\n\n try {\n return JSON5.parse(contents)\n } catch (err) {\n if (!isError(err)) throw err\n const { codeFrameColumns } = require('next/dist/compiled/babel/code-frame')\n const codeFrame = codeFrameColumns(\n String(contents),\n {\n start: {\n line: (err as Error & { lineNumber?: number }).lineNumber || 0,\n column: (err as Error & { columnNumber?: number }).columnNumber || 0,\n },\n },\n { message: err.message, highlightCode: true }\n )\n throw new Error(`Failed to parse \"${filePath}\":\\n${codeFrame}`)\n }\n}\n\nexport type ResolvedBaseUrl =\n | { baseUrl: string; isImplicit: boolean }\n | undefined\n\nexport type JsConfig = { compilerOptions: Record<string, any> } | undefined\n\nexport default async function loadJsConfig(\n dir: string,\n config: NextConfigComplete\n): Promise<{\n useTypeScript: boolean\n jsConfig: JsConfig\n jsConfigPath?: string\n resolvedBaseUrl: ResolvedBaseUrl\n}> {\n let typeScriptPath: string | undefined\n try {\n const deps = await hasNecessaryDependencies(dir, [\n {\n pkg: 'typescript',\n file: 'typescript/lib/typescript.js',\n exportsRestrict: true,\n },\n ])\n typeScriptPath = deps.resolved.get('typescript')\n } catch {}\n const tsConfigPath = path.join(dir, config.typescript.tsconfigPath)\n const useTypeScript = Boolean(typeScriptPath && fs.existsSync(tsConfigPath))\n\n let implicitBaseurl\n let jsConfig: { compilerOptions: Record<string, any> } | undefined\n // jsconfig is a subset of tsconfig\n if (useTypeScript) {\n if (\n config.typescript.tsconfigPath !== 'tsconfig.json' &&\n TSCONFIG_WARNED === false\n ) {\n TSCONFIG_WARNED = true\n Log.info(`Using tsconfig file: ${config.typescript.tsconfigPath}`)\n }\n\n const ts = (await Promise.resolve(\n require(typeScriptPath!)\n )) as typeof import('typescript')\n const tsConfig = await getTypeScriptConfiguration(ts, tsConfigPath, true)\n jsConfig = { compilerOptions: tsConfig.options }\n implicitBaseurl = path.dirname(tsConfigPath)\n }\n\n const jsConfigPath = path.join(dir, 'jsconfig.json')\n if (!useTypeScript && fs.existsSync(jsConfigPath)) {\n jsConfig = parseJsonFile(jsConfigPath)\n implicitBaseurl = path.dirname(jsConfigPath)\n }\n\n let resolvedBaseUrl: ResolvedBaseUrl\n if (jsConfig?.compilerOptions?.baseUrl) {\n resolvedBaseUrl = {\n baseUrl: path.resolve(dir, jsConfig.compilerOptions.baseUrl),\n isImplicit: false,\n }\n } else {\n if (implicitBaseurl) {\n resolvedBaseUrl = {\n baseUrl: implicitBaseurl,\n isImplicit: true,\n }\n }\n }\n\n return {\n useTypeScript,\n jsConfig,\n resolvedBaseUrl,\n jsConfigPath: useTypeScript\n ? tsConfigPath\n : fs.existsSync(jsConfigPath)\n ? jsConfigPath\n : undefined,\n }\n}\n"],"names":["loadJsConfig","parseJsonFile","TSCONFIG_WARNED","filePath","JSON5","require","contents","readFileSync","trim","parse","err","isError","codeFrameColumns","codeFrame","String","start","line","lineNumber","column","columnNumber","message","highlightCode","Error","dir","config","jsConfig","typeScriptPath","deps","hasNecessaryDependencies","pkg","file","exportsRestrict","resolved","get","tsConfigPath","path","join","typescript","tsconfigPath","useTypeScript","Boolean","fs","existsSync","implicitBaseurl","Log","info","ts","Promise","resolve","tsConfig","getTypeScriptConfiguration","compilerOptions","options","dirname","jsConfigPath","resolvedBaseUrl","baseUrl","isImplicit","undefined"],"mappings":"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"}
|
package/dist/build/swc/index.js
CHANGED
|
@@ -119,7 +119,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
119
119
|
}
|
|
120
120
|
return newObj;
|
|
121
121
|
}
|
|
122
|
-
const nextVersion = "15.2.0-canary.
|
|
122
|
+
const nextVersion = "15.2.0-canary.52";
|
|
123
123
|
const ArchName = (0, _os.arch)();
|
|
124
124
|
const PlatformName = (0, _os.platform)();
|
|
125
125
|
function infoLog(...args) {
|
|
@@ -93,11 +93,12 @@ export declare function loadProjectInfo({ dir, config, dev, }: {
|
|
|
93
93
|
dev: boolean;
|
|
94
94
|
}): Promise<{
|
|
95
95
|
jsConfig: JsConfig;
|
|
96
|
+
jsConfigPath?: string;
|
|
96
97
|
resolvedBaseUrl: ResolvedBaseUrl;
|
|
97
98
|
supportedBrowsers: string[] | undefined;
|
|
98
99
|
}>;
|
|
99
100
|
export declare function hasExternalOtelApiPackage(): boolean;
|
|
100
|
-
export default function getBaseWebpackConfig(dir: string, { buildId, encryptionKey, config, compilerType, dev, entrypoints, isDevFallback, pagesDir, reactProductionProfiling, rewrites, originalRewrites, originalRedirects, runWebpackSpan, appDir, middlewareMatchers, jsConfig, resolvedBaseUrl, supportedBrowsers, clientRouterFilters, fetchCacheKeyPrefix, edgePreviewProps, }: {
|
|
101
|
+
export default function getBaseWebpackConfig(dir: string, { buildId, encryptionKey, config, compilerType, dev, entrypoints, isDevFallback, pagesDir, reactProductionProfiling, rewrites, originalRewrites, originalRedirects, runWebpackSpan, appDir, middlewareMatchers, jsConfig, jsConfigPath, resolvedBaseUrl, supportedBrowsers, clientRouterFilters, fetchCacheKeyPrefix, edgePreviewProps, }: {
|
|
101
102
|
buildId: string;
|
|
102
103
|
encryptionKey: string;
|
|
103
104
|
config: NextConfigComplete;
|
|
@@ -115,6 +116,7 @@ export default function getBaseWebpackConfig(dir: string, { buildId, encryptionK
|
|
|
115
116
|
middlewareMatchers?: MiddlewareMatcher[];
|
|
116
117
|
noMangling?: boolean;
|
|
117
118
|
jsConfig: any;
|
|
119
|
+
jsConfigPath?: string;
|
|
118
120
|
resolvedBaseUrl: ResolvedBaseUrl;
|
|
119
121
|
supportedBrowsers: string[] | undefined;
|
|
120
122
|
edgePreviewProps?: Record<string, string>;
|
|
@@ -269,10 +269,11 @@ const NODE_BASE_ESM_RESOLVE_OPTIONS = {
|
|
|
269
269
|
};
|
|
270
270
|
const nextImageLoaderRegex = /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i;
|
|
271
271
|
async function loadProjectInfo({ dir, config, dev }) {
|
|
272
|
-
const { jsConfig, resolvedBaseUrl } = await (0, _loadjsconfig.default)(dir, config);
|
|
272
|
+
const { jsConfig, jsConfigPath, resolvedBaseUrl } = await (0, _loadjsconfig.default)(dir, config);
|
|
273
273
|
const supportedBrowsers = await (0, _utils.getSupportedBrowsers)(dir, dev);
|
|
274
274
|
return {
|
|
275
275
|
jsConfig,
|
|
276
|
+
jsConfigPath,
|
|
276
277
|
resolvedBaseUrl,
|
|
277
278
|
supportedBrowsers
|
|
278
279
|
};
|
|
@@ -286,13 +287,14 @@ function hasExternalOtelApiPackage() {
|
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
289
|
const UNSAFE_CACHE_REGEX = /[\\/]pages[\\/][^\\/]+(?:$|\?|#)/;
|
|
289
|
-
async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compilerType, dev = false, entrypoints, isDevFallback = false, pagesDir, reactProductionProfiling = false, rewrites, originalRewrites, originalRedirects, runWebpackSpan, appDir, middlewareMatchers, jsConfig, resolvedBaseUrl, supportedBrowsers, clientRouterFilters, fetchCacheKeyPrefix, edgePreviewProps }) {
|
|
290
|
+
async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compilerType, dev = false, entrypoints, isDevFallback = false, pagesDir, reactProductionProfiling = false, rewrites, originalRewrites, originalRedirects, runWebpackSpan, appDir, middlewareMatchers, jsConfig, jsConfigPath, resolvedBaseUrl, supportedBrowsers, clientRouterFilters, fetchCacheKeyPrefix, edgePreviewProps }) {
|
|
290
291
|
var _config_experimental, _config_experimental1, _config_watchOptions, _config_experimental_sri, _config_experimental_sri1, _config_compiler, _config_compiler1, _config_compiler2, _jsConfig_compilerOptions, _config_compiler3, _jsConfig_compilerOptions1, _config_compiler4, _jsConfig_compilerOptions2, // always add JsConfigPathsPlugin to allow hot-reloading
|
|
291
292
|
// if the config is added/removed
|
|
292
293
|
_webpackConfig_resolve_plugins, _webpackConfig_resolve, _config_experimental2, _config_compiler5, _config_compiler6, _config_compiler7, _config_compiler8, _config_compiler9, _webpack5Config_plugins, _webpackConfig_module, _webpackConfig_module1, _webpackConfig_module_rules, _webpackConfig_module2;
|
|
293
294
|
const isClient = compilerType === _constants1.COMPILER_NAMES.client;
|
|
294
295
|
const isEdgeServer = compilerType === _constants1.COMPILER_NAMES.edgeServer;
|
|
295
296
|
const isNodeServer = compilerType === _constants1.COMPILER_NAMES.server;
|
|
297
|
+
const isRspack = Boolean(process.env.NEXT_RSPACK);
|
|
296
298
|
// If the current compilation is aimed at server-side code instead of client-side code.
|
|
297
299
|
const isNodeOrEdgeCompilation = isNodeServer || isEdgeServer;
|
|
298
300
|
const hasRewrites = rewrites.beforeFiles.length > 0 || rewrites.afterFiles.length > 0 || rewrites.fallback.length > 0;
|
|
@@ -548,7 +550,12 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
548
550
|
},
|
|
549
551
|
plugins: [
|
|
550
552
|
isNodeServer ? new _optionalpeerdependencyresolveplugin.OptionalPeerDependencyResolverPlugin() : undefined
|
|
551
|
-
].filter(Boolean)
|
|
553
|
+
].filter(Boolean),
|
|
554
|
+
...isRspack && jsConfigPath ? {
|
|
555
|
+
tsConfig: {
|
|
556
|
+
configFile: jsConfigPath
|
|
557
|
+
}
|
|
558
|
+
} : {}
|
|
552
559
|
};
|
|
553
560
|
// Packages which will be split into the 'framework' chunk.
|
|
554
561
|
// Only top-level packages are included, e.g. nested copies like
|
|
@@ -757,22 +764,26 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
757
764
|
const libCacheGroup = {
|
|
758
765
|
test (module1) {
|
|
759
766
|
var _module_type;
|
|
760
|
-
return !((_module_type = module1.type) == null ? void 0 : _module_type.startsWith('css')) &&
|
|
767
|
+
return !((_module_type = module1.type) == null ? void 0 : _module_type.startsWith('css')) && // rspack doesn't support module.size
|
|
768
|
+
(isRspack || module1.size() > 160000) && /node_modules[/\\]/.test(module1.nameForCondition() || '');
|
|
761
769
|
},
|
|
762
770
|
name (module1) {
|
|
763
771
|
const hash = _crypto.default.createHash('sha1');
|
|
764
772
|
if (isModuleCSS(module1)) {
|
|
765
773
|
module1.updateHash(hash);
|
|
766
774
|
} else {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
775
|
+
// rspack doesn't support this
|
|
776
|
+
if (!isRspack) {
|
|
777
|
+
if (!module1.libIdent) {
|
|
778
|
+
throw Object.defineProperty(new Error(`Encountered unknown module type: ${module1.type}. Please open an issue.`), "__NEXT_ERROR_CODE", {
|
|
779
|
+
value: "E487",
|
|
780
|
+
enumerable: false
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
hash.update(module1.libIdent({
|
|
784
|
+
context: dir
|
|
785
|
+
}));
|
|
772
786
|
}
|
|
773
|
-
hash.update(module1.libIdent({
|
|
774
|
-
context: dir
|
|
775
|
-
}));
|
|
776
787
|
}
|
|
777
788
|
// Ensures the name of the chunk is not the same between two modules in different layers
|
|
778
789
|
// E.g. if you import 'button-library' in App Router and Pages Router we don't want these to be bundled in the same chunk
|
|
@@ -792,8 +803,10 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
792
803
|
// as we don't need a separate vendor chunk from that
|
|
793
804
|
// and all other chunk depend on them so there is no
|
|
794
805
|
// duplication that need to be pulled out.
|
|
795
|
-
chunks:
|
|
796
|
-
|
|
806
|
+
chunks: isRspack ? // in rspack
|
|
807
|
+
/(?!polyfills|main|pages\/_app)/ : (chunk)=>!/^(polyfills|main|pages\/_app)$/.test(chunk.name),
|
|
808
|
+
// TODO: investigate these cache groups with rspack
|
|
809
|
+
cacheGroups: isRspack ? {} : {
|
|
797
810
|
framework: frameworkCacheGroup,
|
|
798
811
|
lib: libCacheGroup
|
|
799
812
|
},
|
|
@@ -805,7 +818,14 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
805
818
|
name: _constants1.CLIENT_STATIC_FILES_RUNTIME_WEBPACK
|
|
806
819
|
} : undefined,
|
|
807
820
|
minimize: !dev && (isClient || isEdgeServer || isNodeServer && config.experimental.serverMinification),
|
|
808
|
-
minimizer: [
|
|
821
|
+
minimizer: isRspack ? [
|
|
822
|
+
// @ts-expect-error
|
|
823
|
+
new _webpack.webpack.SwcJsMinimizerRspackPlugin({
|
|
824
|
+
}),
|
|
825
|
+
// @ts-expect-error
|
|
826
|
+
new _webpack.webpack.LightningCssMinimizerRspackPlugin({
|
|
827
|
+
})
|
|
828
|
+
] : [
|
|
809
829
|
// Minify JavaScript
|
|
810
830
|
(compiler)=>{
|
|
811
831
|
// @ts-ignore No typings yet
|
|
@@ -1404,7 +1424,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1404
1424
|
dev && new _memorywithgccacheplugin.MemoryWithGcCachePlugin({
|
|
1405
1425
|
maxGenerations: 5
|
|
1406
1426
|
}),
|
|
1407
|
-
dev && isClient && new _ReactRefreshWebpackPlugin.default(_webpack.webpack),
|
|
1427
|
+
dev && isClient && (isRspack ? new (require('@rspack/plugin-react-refresh'))() : new _ReactRefreshWebpackPlugin.default(_webpack.webpack)),
|
|
1408
1428
|
// Makes sure `Buffer` and `process` are polyfilled in client and flight bundles (same behavior as webpack 4)
|
|
1409
1429
|
(isClient || isEdgeServer) && new _webpack.webpack.ProvidePlugin({
|
|
1410
1430
|
// Buffer is used by getInlineScriptSource
|
|
@@ -1439,7 +1459,8 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1439
1459
|
runtimeAsset: `server/${_constants1.MIDDLEWARE_REACT_LOADABLE_MANIFEST}.js`,
|
|
1440
1460
|
dev
|
|
1441
1461
|
}),
|
|
1442
|
-
|
|
1462
|
+
// rspack doesn't support the parser hooks used here
|
|
1463
|
+
!isRspack && (isClient || isEdgeServer) && new _nextdropclientpageplugin.DropClientPage(),
|
|
1443
1464
|
isNodeServer && !dev && new (require('./webpack/plugins/next-trace-entrypoints-plugin')).TraceEntryPointsPlugin({
|
|
1444
1465
|
rootDir: dir,
|
|
1445
1466
|
appDir: appDir,
|
|
@@ -1502,7 +1523,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1502
1523
|
appDirEnabled: hasAppDir,
|
|
1503
1524
|
clientRouterFilters
|
|
1504
1525
|
}),
|
|
1505
|
-
new _profilingplugin.ProfilingPlugin({
|
|
1526
|
+
!isRspack && new _profilingplugin.ProfilingPlugin({
|
|
1506
1527
|
runWebpackSpan,
|
|
1507
1528
|
rootDir: dir
|
|
1508
1529
|
}),
|
|
@@ -1510,7 +1531,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1510
1531
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1511
1532
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1512
1533
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1513
|
-
cacheKey: "15.2.0-canary.
|
|
1534
|
+
cacheKey: "15.2.0-canary.52",
|
|
1514
1535
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1515
1536
|
minimize: false,
|
|
1516
1537
|
info: {
|
|
@@ -1548,8 +1569,8 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1548
1569
|
isClient && new _nextfontmanifestplugin.NextFontManifestPlugin({
|
|
1549
1570
|
appDir
|
|
1550
1571
|
}),
|
|
1551
|
-
!dev && isClient && config.experimental.cssChunking && new _csschunkingplugin.CssChunkingPlugin(config.experimental.cssChunking === 'strict'),
|
|
1552
|
-
!dev && isClient && new (require('./webpack/plugins/telemetry-plugin/telemetry-plugin')).TelemetryPlugin(new Map([
|
|
1572
|
+
!isRspack && !dev && isClient && config.experimental.cssChunking && new _csschunkingplugin.CssChunkingPlugin(config.experimental.cssChunking === 'strict'),
|
|
1573
|
+
!isRspack && !dev && isClient && new (require('./webpack/plugins/telemetry-plugin/telemetry-plugin')).TelemetryPlugin(new Map([
|
|
1553
1574
|
[
|
|
1554
1575
|
'swcLoader',
|
|
1555
1576
|
useSWCLoader
|
|
@@ -1605,7 +1626,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1605
1626
|
],
|
|
1606
1627
|
SWCBinaryTarget
|
|
1607
1628
|
].filter(Boolean))),
|
|
1608
|
-
!dev && isNodeServer && new (require('./webpack/plugins/telemetry-plugin/telemetry-plugin')).TelemetryPlugin(new Map()),
|
|
1629
|
+
!isRspack && !dev && isNodeServer && new (require('./webpack/plugins/telemetry-plugin/telemetry-plugin')).TelemetryPlugin(new Map()),
|
|
1609
1630
|
shouldEnableSlowModuleDetection && new (require('./webpack/plugins/slow-module-detection-plugin')).default({
|
|
1610
1631
|
compilerType,
|
|
1611
1632
|
...config.experimental.slowModuleDetection
|
|
@@ -1743,7 +1764,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1743
1764
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1744
1765
|
// - Next.js version
|
|
1745
1766
|
// - next.config.js keys that affect compilation
|
|
1746
|
-
version: `${__dirname}|${"15.2.0-canary.
|
|
1767
|
+
version: `${__dirname}|${"15.2.0-canary.52"}|${configVars}`,
|
|
1747
1768
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1748
1769
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1749
1770
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|