next 15.5.1-canary.32 → 15.5.1-canary.33
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 +2 -2
- package/dist/build/next-config-ts/transpile-config.js +25 -0
- package/dist/build/next-config-ts/transpile-config.js.map +1 -1
- package/dist/build/swc/index.js +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/next-server/pages-api-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/next-config-ts/transpile-config.js +26 -1
- package/dist/esm/build/next-config-ts/transpile-config.js.map +1 -1
- package/dist/esm/build/swc/index.js +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-shared.js +1 -1
- package/dist/esm/server/config-shared.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/start-server.js +1 -1
- package/dist/esm/server/lib/utils.js +1 -1
- package/dist/esm/server/lib/utils.js.map +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/config-shared.d.ts +1 -3
- package/dist/server/config-shared.js +1 -1
- package/dist/server/config-shared.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/start-server.js +1 -1
- package/dist/server/lib/utils.d.ts +7 -0
- package/dist/server/lib/utils.js +5 -6
- package/dist/server/lib/utils.js.map +1 -1
- package/dist/shared/lib/canary-only.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
@@ -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.5.1-canary.
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.5.1-canary.33"}`, '-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
@@ -369,7 +369,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
369
369
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
370
370
|
buildMode: experimentalBuildMode,
|
371
371
|
isTurboBuild: String(isTurbopack),
|
372
|
-
version: "15.5.1-canary.
|
372
|
+
version: "15.5.1-canary.33"
|
373
373
|
});
|
374
374
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
375
375
|
_buildcontext.NextBuildContext.dir = dir;
|
@@ -848,7 +848,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
848
848
|
// Files outside of the distDir can be "type": "module"
|
849
849
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
850
850
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
851
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.5.1-canary.
|
851
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.5.1-canary.33");
|
852
852
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
853
853
|
buildStage: 'start'
|
854
854
|
});
|
@@ -10,9 +10,11 @@ Object.defineProperty(exports, "transpileConfig", {
|
|
10
10
|
});
|
11
11
|
const _nodepath = require("node:path");
|
12
12
|
const _promises = require("node:fs/promises");
|
13
|
+
const _nodeurl = require("node:url");
|
13
14
|
const _requirehook = require("./require-hook");
|
14
15
|
const _log = require("../output/log");
|
15
16
|
const _installdependencies = require("../../lib/install-dependencies");
|
17
|
+
const _utils = require("../../server/lib/utils");
|
16
18
|
function resolveSWCOptions(cwd, compilerOptions) {
|
17
19
|
var _process_versions, _process;
|
18
20
|
return {
|
@@ -88,8 +90,31 @@ async function getTsConfig(cwd) {
|
|
88
90
|
const parsedCommandLine = ts.parseJsonConfigFileContent(configFile.config, ts.sys, cwd);
|
89
91
|
return parsedCommandLine.options;
|
90
92
|
}
|
93
|
+
let useNodeNativeTSLoader = true;
|
91
94
|
async function transpileConfig({ nextConfigPath, configFileName, cwd }) {
|
92
95
|
try {
|
96
|
+
if (useNodeNativeTSLoader) {
|
97
|
+
try {
|
98
|
+
// Node.js v22.10.0+
|
99
|
+
// Value is 'strip' or 'transform' based on how the feature is enabled.
|
100
|
+
// https://nodejs.org/api/process.html#processfeaturestypescript
|
101
|
+
if (process.features.typescript) {
|
102
|
+
return import((0, _nodeurl.pathToFileURL)(nextConfigPath).href);
|
103
|
+
}
|
104
|
+
if ((0, _utils.getNodeOptionsArgs)().includes('--no-experimental-strip-types') || process.execArgv.includes('--no-experimental-strip-types')) {
|
105
|
+
// TODO: Add Next.js docs link.
|
106
|
+
(0, _log.warnOnce)(`Skipped resolving "${configFileName}" using Node.js native TypeScript resolution because it was disabled by the "--no-experimental-strip-types" flag.` + ' Falling back to legacy resolution.');
|
107
|
+
}
|
108
|
+
// Feature is not enabled, fallback to legacy resolution for current session.
|
109
|
+
useNodeNativeTSLoader = false;
|
110
|
+
} catch (cause) {
|
111
|
+
(0, _log.warnOnce)(`Failed to import "${configFileName}" using Node.js native TypeScript resolution.` + ' Falling back to legacy resolution.', {
|
112
|
+
cause
|
113
|
+
});
|
114
|
+
// Once failed, fallback to legacy resolution for current session.
|
115
|
+
useNodeNativeTSLoader = false;
|
116
|
+
}
|
117
|
+
}
|
93
118
|
// Ensure TypeScript is installed to use the API.
|
94
119
|
await verifyTypeScriptSetup(cwd, configFileName);
|
95
120
|
const compilerOptions = await getTsConfig(cwd);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/build/next-config-ts/transpile-config.ts"],"sourcesContent":["import type { Options as SWCOptions } from '@swc/core'\nimport type { CompilerOptions } from 'typescript'\n\nimport { resolve } from 'node:path'\nimport { readFile } from 'node:fs/promises'\nimport { deregisterHook, registerHook, requireFromString } from './require-hook'\nimport { warn } from '../output/log'\nimport { installDependencies } from '../../lib/install-dependencies'\n\nfunction resolveSWCOptions(\n cwd: string,\n compilerOptions: CompilerOptions\n): SWCOptions {\n return {\n jsc: {\n parser: {\n syntax: 'typescript',\n },\n ...(compilerOptions.paths ? { paths: compilerOptions.paths } : {}),\n ...(compilerOptions.baseUrl\n ? // Needs to be an absolute path.\n { baseUrl: resolve(cwd, compilerOptions.baseUrl) }\n : compilerOptions.paths\n ? // If paths is given, baseUrl is required.\n { baseUrl: cwd }\n : {}),\n },\n module: {\n type: 'commonjs',\n },\n isModule: 'unknown',\n env: {\n targets: {\n // Setting the Node.js version can reduce unnecessary code generation.\n node: process?.versions?.node ?? '20.19.0',\n },\n },\n } satisfies SWCOptions\n}\n\n// Ported from next/src/lib/verify-typescript-setup.ts\n// Although this overlaps with the later `verifyTypeScriptSetup`,\n// it is acceptable since the time difference in the worst case is trivial,\n// as we are only preparing to install the dependencies once more.\nasync function verifyTypeScriptSetup(cwd: string, configFileName: string) {\n try {\n // Quick module check.\n require.resolve('typescript', { paths: [cwd] })\n } catch (error) {\n if (\n error &&\n typeof error === 'object' &&\n 'code' in error &&\n error.code === 'MODULE_NOT_FOUND'\n ) {\n warn(\n `Installing TypeScript as it was not found while loading \"${configFileName}\".`\n )\n\n await installDependencies(cwd, [{ pkg: 'typescript' }], true).catch(\n (err) => {\n if (err && typeof err === 'object' && 'command' in err) {\n console.error(\n `Failed to install TypeScript, please install it manually to continue:\\n` +\n (err as any).command +\n '\\n'\n )\n }\n throw err\n }\n )\n }\n }\n}\n\nasync function getTsConfig(cwd: string): Promise<CompilerOptions> {\n const ts: typeof import('typescript') = require(\n require.resolve('typescript', { paths: [cwd] })\n )\n\n // NOTE: This doesn't fully cover the edge case for setting\n // \"typescript.tsconfigPath\" in next config which is currently\n // a restriction.\n const tsConfigPath = ts.findConfigFile(\n cwd,\n ts.sys.fileExists,\n 'tsconfig.json'\n )\n\n if (!tsConfigPath) {\n // It is ok to not return ts.getDefaultCompilerOptions() because\n // we are only looking for paths and baseUrl from tsConfig.\n return {}\n }\n\n const configFile = ts.readConfigFile(tsConfigPath, ts.sys.readFile)\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n cwd\n )\n\n return parsedCommandLine.options\n}\n\nexport async function transpileConfig({\n nextConfigPath,\n configFileName,\n cwd,\n}: {\n nextConfigPath: string\n configFileName: string\n cwd: string\n}) {\n try {\n // Ensure TypeScript is installed to use the API.\n await verifyTypeScriptSetup(cwd, configFileName)\n const compilerOptions = await getTsConfig(cwd)\n\n return handleCJS({ cwd, nextConfigPath, compilerOptions })\n } catch (cause) {\n throw new Error(`Failed to transpile \"${configFileName}\".`, {\n cause,\n })\n }\n}\n\nasync function handleCJS({\n cwd,\n nextConfigPath,\n compilerOptions,\n}: {\n cwd: string\n nextConfigPath: string\n compilerOptions: CompilerOptions\n}) {\n const swcOptions = resolveSWCOptions(cwd, compilerOptions)\n let hasRequire = false\n try {\n const nextConfigString = await readFile(nextConfigPath, 'utf8')\n // lazy require swc since it loads React before even setting NODE_ENV\n // resulting loading Development React on Production\n const { transform } = require('../swc') as typeof import('../swc')\n const { code } = await transform(nextConfigString, swcOptions)\n\n // register require hook only if require exists\n if (code.includes('require(')) {\n registerHook(swcOptions)\n hasRequire = true\n }\n\n // filename & extension don't matter here\n return requireFromString(code, resolve(cwd, 'next.config.compiled.js'))\n } catch (error) {\n throw error\n } finally {\n if (hasRequire) {\n deregisterHook()\n }\n }\n}\n"],"names":["transpileConfig","resolveSWCOptions","cwd","compilerOptions","process","jsc","parser","syntax","paths","baseUrl","resolve","module","type","isModule","env","targets","node","versions","verifyTypeScriptSetup","configFileName","require","error","code","warn","installDependencies","pkg","catch","err","console","command","getTsConfig","ts","tsConfigPath","findConfigFile","sys","fileExists","configFile","readConfigFile","readFile","parsedCommandLine","parseJsonConfigFileContent","config","options","nextConfigPath","handleCJS","cause","Error","swcOptions","hasRequire","nextConfigString","transform","includes","registerHook","requireFromString","deregisterHook"],"mappings":";;;;+BAyGsBA;;;eAAAA;;;0BAtGE;0BACC;6BACuC;qBAC3C;qCACe;AAEpC,SAASC,kBACPC,GAAW,EACXC,eAAgC;QAuBpBC,mBAAAA;IArBZ,OAAO;QACLC,KAAK;Y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BAAY,EAACL;YACbC,aAAa;QACf;QAEA,yCAAyC;QACzC,OAAOK,IAAAA,8BAAiB,EAAC/B,MAAMZ,IAAAA,iBAAO,EAACR,KAAK;IAC9C,EAAE,OAAOmB,OAAO;QACd,MAAMA;IACR,SAAU;QACR,IAAI2B,YAAY;YACdM,IAAAA,2BAAc;QAChB;IACF;AACF","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../src/build/next-config-ts/transpile-config.ts"],"sourcesContent":["import type { Options as SWCOptions } from '@swc/core'\nimport type { CompilerOptions } from 'typescript'\n\nimport { resolve } from 'node:path'\nimport { readFile } from 'node:fs/promises'\nimport { pathToFileURL } from 'node:url'\nimport { deregisterHook, registerHook, requireFromString } from './require-hook'\nimport { warn, warnOnce } from '../output/log'\nimport { installDependencies } from '../../lib/install-dependencies'\nimport { getNodeOptionsArgs } from '../../server/lib/utils'\n\nfunction resolveSWCOptions(\n cwd: string,\n compilerOptions: CompilerOptions\n): SWCOptions {\n return {\n jsc: {\n parser: {\n syntax: 'typescript',\n },\n ...(compilerOptions.paths ? { paths: compilerOptions.paths } : {}),\n ...(compilerOptions.baseUrl\n ? // Needs to be an absolute path.\n { baseUrl: resolve(cwd, compilerOptions.baseUrl) }\n : compilerOptions.paths\n ? // If paths is given, baseUrl is required.\n { baseUrl: cwd }\n : {}),\n },\n module: {\n type: 'commonjs',\n },\n isModule: 'unknown',\n env: {\n targets: {\n // Setting the Node.js version can reduce unnecessary code generation.\n node: process?.versions?.node ?? '20.19.0',\n },\n },\n } satisfies SWCOptions\n}\n\n// Ported from next/src/lib/verify-typescript-setup.ts\n// Although this overlaps with the later `verifyTypeScriptSetup`,\n// it is acceptable since the time difference in the worst case is trivial,\n// as we are only preparing to install the dependencies once more.\nasync function verifyTypeScriptSetup(cwd: string, configFileName: string) {\n try {\n // Quick module check.\n require.resolve('typescript', { paths: [cwd] })\n } catch (error) {\n if (\n error &&\n typeof error === 'object' &&\n 'code' in error &&\n error.code === 'MODULE_NOT_FOUND'\n ) {\n warn(\n `Installing TypeScript as it was not found while loading \"${configFileName}\".`\n )\n\n await installDependencies(cwd, [{ pkg: 'typescript' }], true).catch(\n (err) => {\n if (err && typeof err === 'object' && 'command' in err) {\n console.error(\n `Failed to install TypeScript, please install it manually to continue:\\n` +\n (err as any).command +\n '\\n'\n )\n }\n throw err\n }\n )\n }\n }\n}\n\nasync function getTsConfig(cwd: string): Promise<CompilerOptions> {\n const ts: typeof import('typescript') = require(\n require.resolve('typescript', { paths: [cwd] })\n )\n\n // NOTE: This doesn't fully cover the edge case for setting\n // \"typescript.tsconfigPath\" in next config which is currently\n // a restriction.\n const tsConfigPath = ts.findConfigFile(\n cwd,\n ts.sys.fileExists,\n 'tsconfig.json'\n )\n\n if (!tsConfigPath) {\n // It is ok to not return ts.getDefaultCompilerOptions() because\n // we are only looking for paths and baseUrl from tsConfig.\n return {}\n }\n\n const configFile = ts.readConfigFile(tsConfigPath, ts.sys.readFile)\n const parsedCommandLine = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n cwd\n )\n\n return parsedCommandLine.options\n}\n\nlet useNodeNativeTSLoader = true\n\nexport async function transpileConfig({\n nextConfigPath,\n configFileName,\n cwd,\n}: {\n nextConfigPath: string\n configFileName: string\n cwd: string\n}) {\n try {\n if (useNodeNativeTSLoader) {\n try {\n // Node.js v22.10.0+\n // Value is 'strip' or 'transform' based on how the feature is enabled.\n // https://nodejs.org/api/process.html#processfeaturestypescript\n if ((process.features as any).typescript) {\n return import(pathToFileURL(nextConfigPath).href)\n }\n\n if (\n getNodeOptionsArgs().includes('--no-experimental-strip-types') ||\n process.execArgv.includes('--no-experimental-strip-types')\n ) {\n // TODO: Add Next.js docs link.\n warnOnce(\n `Skipped resolving \"${configFileName}\" using Node.js native TypeScript resolution because it was disabled by the \"--no-experimental-strip-types\" flag.` +\n ' Falling back to legacy resolution.'\n )\n }\n\n // Feature is not enabled, fallback to legacy resolution for current session.\n useNodeNativeTSLoader = false\n } catch (cause) {\n warnOnce(\n `Failed to import \"${configFileName}\" using Node.js native TypeScript resolution.` +\n ' Falling back to legacy resolution.',\n { cause }\n )\n // Once failed, fallback to legacy resolution for current session.\n useNodeNativeTSLoader = false\n }\n }\n\n // Ensure TypeScript is installed to use the API.\n await verifyTypeScriptSetup(cwd, configFileName)\n const compilerOptions = await getTsConfig(cwd)\n\n return handleCJS({ cwd, nextConfigPath, compilerOptions })\n } catch (cause) {\n throw new Error(`Failed to transpile \"${configFileName}\".`, {\n cause,\n })\n }\n}\n\nasync function handleCJS({\n cwd,\n nextConfigPath,\n compilerOptions,\n}: {\n cwd: string\n nextConfigPath: string\n compilerOptions: CompilerOptions\n}) {\n const swcOptions = resolveSWCOptions(cwd, compilerOptions)\n let hasRequire = false\n try {\n const nextConfigString = await readFile(nextConfigPath, 'utf8')\n // lazy require swc since it loads React before even setting NODE_ENV\n // resulting loading Development React on Production\n const { transform } = require('../swc') as typeof import('../swc')\n const { code } = await transform(nextConfigString, swcOptions)\n\n // register require hook only if require exists\n if (code.includes('require(')) {\n registerHook(swcOptions)\n hasRequire = true\n }\n\n // filename & extension don't matter here\n return requireFromString(code, resolve(cwd, 'next.config.compiled.js'))\n } catch (error) {\n throw error\n } finally {\n if (hasRequire) {\n deregisterHook()\n }\n }\n}\n"],"names":["transpileConfig","resolveSWCOptions","cwd","compilerOptions","process","jsc","parser","syntax","paths","baseUrl","resolve","module","type","isModule","env","targets","node","versions","verifyTypeScriptSetup","configFileName","require","error","code","warn","installDependencies","pkg","catch","err","console","command","getTsConfig","ts","tsConfigPath","findConfigFile","sys","fileExists","configFile","readConfigFile","readFile","parsedCommandLine","parseJsonConfigFileContent","config","options","useNodeNativeTSLoader","nextConfigPath","features","typescript","pathToFileURL","href","getNodeOptionsArgs","includes","execArgv","warnOnce","cause","handleCJS","Error","swcOptions","hasRequire","nextConfigString","transform","registerHook","requireFromString","deregisterHook"],"mappings":";;;;+BA6GsBA;;;eAAAA;;;0BA1GE;0BACC;yBACK;6BACkC;qBAC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;QAEA,iDAAiD;QACjD,MAAMzB,sBAAsBhB,KAAKiB;QACjC,MAAMhB,kBAAkB,MAAM2B,YAAY5B;QAE1C,OAAOoD,UAAU;YAAEpD;YAAK0C;YAAgBzC;QAAgB;IAC1D,EAAE,OAAOkD,OAAO;QACd,MAAM,qBAEJ,CAFI,IAAIE,MAAM,CAAC,qBAAqB,EAAEpC,eAAe,EAAE,CAAC,EAAE;YAC1DkC;QACF,IAFM,qBAAA;mBAAA;wBAAA;0BAAA;QAEL;IACH;AACF;AAEA,eAAeC,UAAU,EACvBpD,GAAG,EACH0C,cAAc,EACdzC,eAAe,EAKhB;IACC,MAAMqD,aAAavD,kBAAkBC,KAAKC;IAC1C,IAAIsD,aAAa;IACjB,IAAI;QACF,MAAMC,mBAAmB,MAAMpB,IAAAA,kBAAQ,EAACM,gBAAgB;QACxD,qEAAqE;QACrE,oDAAoD;QACpD,MAAM,EAAEe,SAAS,EAAE,GAAGvC,QAAQ;QAC9B,MAAM,EAAEE,IAAI,EAAE,GAAG,MAAMqC,UAAUD,kBAAkBF;QAEnD,+CAA+C;QAC/C,IAAIlC,KAAK4B,QAAQ,CAAC,aAAa;YAC7BU,IAAAA,yBAAY,EAACJ;YACbC,aAAa;QACf;QAEA,yCAAyC;QACzC,OAAOI,IAAAA,8BAAiB,EAACvC,MAAMZ,IAAAA,iBAAO,EAACR,KAAK;IAC9C,EAAE,OAAOmB,OAAO;QACd,MAAMA;IACR,SAAU;QACR,IAAIoC,YAAY;YACdK,IAAAA,2BAAc;QAChB;IACF;AACF","ignoreList":[0]}
|
package/dist/build/swc/index.js
CHANGED
@@ -131,7 +131,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
131
131
|
}
|
132
132
|
return newObj;
|
133
133
|
}
|
134
|
-
const nextVersion = "15.5.1-canary.
|
134
|
+
const nextVersion = "15.5.1-canary.33";
|
135
135
|
const ArchName = (0, _os.arch)();
|
136
136
|
const PlatformName = (0, _os.platform)();
|
137
137
|
function infoLog(...args) {
|
@@ -1711,7 +1711,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1711
1711
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
1712
1712
|
// file path to build output of `@next/polyfill-nomodule`
|
1713
1713
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1714
|
-
cacheKey: "15.5.1-canary.
|
1714
|
+
cacheKey: "15.5.1-canary.33",
|
1715
1715
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1716
1716
|
minimize: false,
|
1717
1717
|
info: {
|
@@ -1895,7 +1895,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1895
1895
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1896
1896
|
// - Next.js version
|
1897
1897
|
// - next.config.js keys that affect compilation
|
1898
|
-
version: `${__dirname}|${"15.5.1-canary.
|
1898
|
+
version: `${__dirname}|${"15.5.1-canary.33"}|${configVars}`,
|
1899
1899
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
1900
1900
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1901
1901
|
// 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.5.1-canary.
|
18
|
+
const version = "15.5.1-canary.33";
|
19
19
|
window.next = {
|
20
20
|
version,
|
21
21
|
appDir: true
|
package/dist/client/index.js
CHANGED
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
61
61
|
const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
63
63
|
const _isnextroutererror = require("./components/is-next-router-error");
|
64
|
-
const version = "15.5.1-canary.
|
64
|
+
const version = "15.5.1-canary.33";
|
65
65
|
let router;
|
66
66
|
const emitter = (0, _mitt.default)();
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|