next 15.3.0-canary.6 → 15.3.0-canary.8
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/create-compiler-aliases.js +9 -0
- package/dist/build/create-compiler-aliases.js.map +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack/plugins/define-env-plugin.js +1 -0
- package/dist/build/webpack/plugins/define-env-plugin.js.map +1 -1
- package/dist/build/webpack-config.js +4 -6
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/app-index.js +1 -0
- package/dist/client/app-index.js.map +1 -1
- package/dist/client/app-next-dev.d.ts +1 -0
- package/dist/client/app-next-dev.js +1 -0
- package/dist/client/app-next-dev.js.map +1 -1
- package/dist/client/app-next-turbopack.d.ts +1 -1
- package/dist/client/app-next-turbopack.js +1 -0
- package/dist/client/app-next-turbopack.js.map +1 -1
- package/dist/client/app-next.d.ts +1 -0
- package/dist/client/app-next.js +1 -0
- package/dist/client/app-next.js.map +1 -1
- package/dist/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js +2 -2
- package/dist/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/next-turbopack.d.ts +1 -1
- package/dist/client/next-turbopack.js +1 -1
- package/dist/client/next-turbopack.js.map +1 -1
- package/dist/client/next.d.ts +1 -0
- package/dist/client/next.js +1 -0
- package/dist/client/next.js.map +1 -1
- package/dist/client/page-bootstrap.d.ts +1 -0
- package/dist/client/page-bootstrap.js +1 -0
- package/dist/client/page-bootstrap.js.map +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 +4 -4
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/create-compiler-aliases.js +9 -0
- package/dist/esm/build/create-compiler-aliases.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/plugins/define-env-plugin.js +1 -0
- package/dist/esm/build/webpack/plugins/define-env-plugin.js.map +1 -1
- package/dist/esm/build/webpack-config.js +5 -7
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/app-index.js +1 -0
- package/dist/esm/client/app-index.js.map +1 -1
- package/dist/esm/client/app-next-dev.js +1 -0
- package/dist/esm/client/app-next-dev.js.map +1 -1
- package/dist/esm/client/app-next-turbopack.js +1 -0
- package/dist/esm/client/app-next-turbopack.js.map +1 -1
- package/dist/esm/client/app-next.js +1 -0
- package/dist/esm/client/app-next.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js +2 -2
- package/dist/esm/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js.map +1 -1
- package/dist/esm/client/index.js +2 -1
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/client/next-turbopack.js +1 -0
- package/dist/esm/client/next-turbopack.js.map +1 -1
- package/dist/esm/client/next.js +1 -0
- package/dist/esm/client/next.js.map +1 -1
- package/dist/esm/client/page-bootstrap.js +1 -0
- package/dist/esm/client/page-bootstrap.js.map +1 -1
- package/dist/esm/lib/require-instrumentation-client.js +10 -0
- package/dist/esm/lib/require-instrumentation-client.js.map +1 -0
- package/dist/esm/server/base-server.js +2 -1
- package/dist/esm/server/base-server.js.map +1 -1
- package/dist/esm/server/config-schema.js +2 -1
- package/dist/esm/server/config-schema.js.map +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/decode-query-path-parameter.js +16 -0
- package/dist/esm/server/lib/decode-query-path-parameter.js.map +1 -0
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/typescript/index.js +7 -4
- package/dist/esm/server/typescript/index.js.map +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/lib/require-instrumentation-client.d.ts +6 -0
- package/dist/lib/require-instrumentation-client.js +11 -0
- package/dist/lib/require-instrumentation-client.js.map +1 -0
- package/dist/server/base-server.js +2 -1
- package/dist/server/base-server.js.map +1 -1
- package/dist/server/config-schema.js +2 -1
- package/dist/server/config-schema.js.map +1 -1
- package/dist/server/config-shared.d.ts +8 -0
- 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/decode-query-path-parameter.d.ts +7 -0
- package/dist/server/lib/decode-query-path-parameter.js +26 -0
- package/dist/server/lib/decode-query-path-parameter.js.map +1 -0
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/typescript/index.js +7 -4
- package/dist/server/typescript/index.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.3.0-canary.
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.3.0-canary.8"}`, '-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('--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([
|
84
84
|
'compile',
|
85
85
|
'generate',
|
@@ -160,6 +160,15 @@ function createWebpackAliases({ distDir, isClient, isEdgeServer, isNodeServer, d
|
|
160
160
|
[_constants.APP_DIR_ALIAS]: appDir
|
161
161
|
} : {},
|
162
162
|
[_constants.ROOT_DIR_ALIAS]: dir,
|
163
|
+
...isClient ? {
|
164
|
+
'private-next-instrumentation-client': [
|
165
|
+
_path.default.join(dir, 'src', 'instrumentation-client'),
|
166
|
+
_path.default.join(dir, 'instrumentation-client'),
|
167
|
+
'private-next-empty-module'
|
168
|
+
],
|
169
|
+
// disable typechecker, webpack5 allows aliases to be set to false to create a no-op module
|
170
|
+
'private-next-empty-module': false
|
171
|
+
} : {},
|
163
172
|
[_constants.DOT_NEXT_ALIAS]: distDir,
|
164
173
|
...isClient || isEdgeServer ? getOptimizedModuleAliases() : {},
|
165
174
|
...reactProductionProfiling ? getReactProfilingInProduction() : {},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { WEBPACK_LAYERS } from '../lib/constants'\nimport { isWebpackServerOnlyLayer } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n isNodeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n hasRewrites,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n hasRewrites: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const clientResolveRewrites = require.resolve(\n '../shared/lib/router/utils/resolve-rewrites'\n )\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n // For Node server, we need to re-alias the package imports to prefer to\n // resolve to the ESM export.\n ...(isNodeServer\n ? getBarrelOptimizationAliases(\n config.experimental.optimizePackageImports || []\n )\n : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n\n ...(isClient || isEdgeServer\n ? {\n [clientResolveRewrites]: hasRewrites\n ? clientResolveRewrites\n : // With webpack 5 an alias can be pointed to false to noop\n false,\n }\n : {}),\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\nexport function createRSCAliases(\n bundledReactChannel: string,\n {\n layer,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const isServerOnlyLayer = isWebpackServerOnlyLayer(layer)\n // For middleware, instrumentation layers, treat them as rsc layer.\n // Since we only built the runtime package for rsc, convert everything to rsc\n // to ensure the runtime modules path existed.\n if (isServerOnlyLayer) {\n layer = WEBPACK_LAYERS.reactServerComponents\n }\n\n let alias: Record<string, string> = {\n react$: `next/dist/compiled/react${bundledReactChannel}`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react-dom/client$': `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': `next/dist/compiled/react-dom${bundledReactChannel}/server`,\n 'react-dom/server.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/static$': `next/dist/compiled/react-dom${bundledReactChannel}/static`,\n 'react-dom/static.edge$': `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': `next/dist/build/webpack/alias/react-dom-server-edge${bundledReactChannel}.js`,\n // react-server-dom-webpack alias\n 'react-server-dom-webpack/client$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client`,\n 'react-server-dom-webpack/client.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n if (!isEdgeServer) {\n if (layer === WEBPACK_LAYERS.serverSideRendering) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/client.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-client-edge`,\n })\n } else if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/server.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-static-edge`,\n })\n }\n }\n\n if (isEdgeServer) {\n if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n react$: `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react$': `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react-experimental$': `next/dist/compiled/react-experimental/react.react-server`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'next/dist/compiled/react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-runtime$': `next/dist/compiled/react-experimental/jsx-runtime.react-server`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-dev-runtime$': `next/dist/compiled/react-experimental/jsx-dev-runtime.react-server`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom-experimental$': `next/dist/compiled/react-dom-experimental/react-dom.react-server`,\n })\n }\n }\n\n if (reactProductionProfiling) {\n alias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\n// Alias these modules to be resolved with \"module\" if possible.\nfunction getBarrelOptimizationAliases(packages: string[]): CompilerAliases {\n const aliases: { [pkg: string]: string } = {}\n const mainFields = ['module', 'main']\n\n for (const pkg of packages) {\n try {\n const descriptionFileData = require(`${pkg}/package.json`)\n const descriptionFilePath = require.resolve(`${pkg}/package.json`)\n\n for (const field of mainFields) {\n if (descriptionFileData.hasOwnProperty(field)) {\n aliases[pkg + '$'] = path.join(\n path.dirname(descriptionFilePath),\n descriptionFileData[field]\n )\n break\n }\n }\n } catch {}\n }\n\n return aliases\n}\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["createAppRouterApiAliases","createNextApiEsmAliases","createRSCAliases","createServerOnlyClientOnlyAliases","createWebpackAliases","getOptimizedModuleAliases","isReact19","React","use","distDir","isClient","isEdgeServer","isNodeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","hasRewrites","pageExtensions","clientResolveRewrites","require","resolve","customAppAliases","customDocumentAliases","nextDistPath","PAGES_DIR_ALIAS","reduce","prev","ext","push","path","join","undefined","hasExternalOtelApiPackage","images","loaderFile","defaultOverrides","APP_DIR_ALIAS","ROOT_DIR_ALIAS","DOT_NEXT_ALIAS","getReactProfilingInProduction","getBarrelOptimizationAliases","experimental","optimizePackageImports","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","dirname","setimmediate","isServer","mapping","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","NEXT_PROJECT_ROOT","isServerOnlyLayer","bundledReactChannel","layer","isWebpackServerOnlyLayer","WEBPACK_LAYERS","reactServerComponents","alias","react$","serverSideRendering","assign","unfetch","url","packages","aliases","mainFields","pkg","descriptionFileData","descriptionFilePath","field","hasOwnProperty"],"mappings":";;;;;;;;;;;;;;;;;;;IA2OgBA,yBAAyB;eAAzBA;;IA5BAC,uBAAuB;eAAvBA;;I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QAEF,gBAAgBD,QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFgE,KAAKjE,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,gEAAgE;AAChE,SAASoB,6BAA6B6C,QAAkB;IACtD,MAAMC,UAAqC,CAAC;IAC5C,MAAMC,aAAa;QAAC;QAAU;KAAO;IAErC,KAAK,MAAMC,OAAOH,SAAU;QAC1B,IAAI;YACF,MAAMI,sBAAsBtE,QAAQ,GAAGqE,IAAI,aAAa,CAAC;YACzD,MAAME,sBAAsBvE,QAAQC,OAAO,CAAC,GAAGoE,IAAI,aAAa,CAAC;YAEjE,KAAK,MAAMG,SAASJ,WAAY;gBAC9B,IAAIE,oBAAoBG,cAAc,CAACD,QAAQ;oBAC7CL,OAAO,CAACE,MAAM,IAAI,GAAG3D,aAAI,CAACC,IAAI,CAC5BD,aAAI,CAACmB,OAAO,CAAC0C,sBACbD,mBAAmB,CAACE,MAAM;oBAE5B;gBACF;YACF;QACF,EAAE,OAAM,CAAC;IACX;IAEA,OAAOL;AACT;AACA,SAAS/C;IACP,OAAO;QACL,qBAAqB;IACvB;AACF"}
|
1
|
+
{"version":3,"sources":["../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { WEBPACK_LAYERS } from '../lib/constants'\nimport { isWebpackServerOnlyLayer } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n isNodeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n hasRewrites,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n hasRewrites: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const clientResolveRewrites = require.resolve(\n '../shared/lib/router/utils/resolve-rewrites'\n )\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n ...(isClient\n ? {\n 'private-next-instrumentation-client': [\n path.join(dir, 'src', 'instrumentation-client'),\n path.join(dir, 'instrumentation-client'),\n 'private-next-empty-module',\n ],\n\n // disable typechecker, webpack5 allows aliases to be set to false to create a no-op module\n 'private-next-empty-module': false as any,\n }\n : {}),\n\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n // For Node server, we need to re-alias the package imports to prefer to\n // resolve to the ESM export.\n ...(isNodeServer\n ? getBarrelOptimizationAliases(\n config.experimental.optimizePackageImports || []\n )\n : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n\n ...(isClient || isEdgeServer\n ? {\n [clientResolveRewrites]: hasRewrites\n ? clientResolveRewrites\n : // With webpack 5 an alias can be pointed to false to noop\n false,\n }\n : {}),\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\nexport function createRSCAliases(\n bundledReactChannel: string,\n {\n layer,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const isServerOnlyLayer = isWebpackServerOnlyLayer(layer)\n // For middleware, instrumentation layers, treat them as rsc layer.\n // Since we only built the runtime package for rsc, convert everything to rsc\n // to ensure the runtime modules path existed.\n if (isServerOnlyLayer) {\n layer = WEBPACK_LAYERS.reactServerComponents\n }\n\n let alias: Record<string, string> = {\n react$: `next/dist/compiled/react${bundledReactChannel}`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react-dom/client$': `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': `next/dist/compiled/react-dom${bundledReactChannel}/server`,\n 'react-dom/server.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/static$': `next/dist/compiled/react-dom${bundledReactChannel}/static`,\n 'react-dom/static.edge$': `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': `next/dist/build/webpack/alias/react-dom-server-edge${bundledReactChannel}.js`,\n // react-server-dom-webpack alias\n 'react-server-dom-webpack/client$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client`,\n 'react-server-dom-webpack/client.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n if (!isEdgeServer) {\n if (layer === WEBPACK_LAYERS.serverSideRendering) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/client.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-client-edge`,\n })\n } else if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/server.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-static-edge`,\n })\n }\n }\n\n if (isEdgeServer) {\n if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n react$: `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react$': `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react-experimental$': `next/dist/compiled/react-experimental/react.react-server`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'next/dist/compiled/react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-runtime$': `next/dist/compiled/react-experimental/jsx-runtime.react-server`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-dev-runtime$': `next/dist/compiled/react-experimental/jsx-dev-runtime.react-server`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom-experimental$': `next/dist/compiled/react-dom-experimental/react-dom.react-server`,\n })\n }\n }\n\n if (reactProductionProfiling) {\n alias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\n// Alias these modules to be resolved with \"module\" if possible.\nfunction getBarrelOptimizationAliases(packages: string[]): CompilerAliases {\n const aliases: { [pkg: string]: string } = {}\n const mainFields = ['module', 'main']\n\n for (const pkg of packages) {\n try {\n const descriptionFileData = require(`${pkg}/package.json`)\n const descriptionFilePath = require.resolve(`${pkg}/package.json`)\n\n for (const field of mainFields) {\n if (descriptionFileData.hasOwnProperty(field)) {\n aliases[pkg + '$'] = path.join(\n path.dirname(descriptionFilePath),\n descriptionFileData[field]\n )\n break\n }\n }\n } catch {}\n }\n\n return aliases\n}\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["createAppRouterApiAliases","createNextApiEsmAliases","createRSCAliases","createServerOnlyClientOnlyAliases","createWebpackAliases","getOptimizedModuleAliases","isReact19","React","use","distDir","isClient","isEdgeServer","isNodeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","hasRewrites","pageExtensions","clientResolveRewrites","require","resolve","customAppAliases","customDocumentAliases","nextDistPath","PAGES_DIR_ALIAS","reduce","prev","ext","push","path","join","undefined","hasExternalOtelApiPackage","images","loaderFile","defaultOverrides","APP_DIR_ALIAS","ROOT_DIR_ALIAS","DOT_NEXT_ALIAS","getReactProfilingInProduction","getBarrelOptimizationAliases","experimental","optimizePackageImports","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","dirname","setimmediate","isServer","mapping","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","NEXT_PROJECT_ROOT","isServerOnlyLayer","bundledReactChannel","layer","isWebpackServerOnlyLayer","WEBPACK_LAYERS","reactServerComponents","alias","react$","serverSideRendering","assign","unfetch","url","packages","aliases","mainFields","pkg","descriptionFileData","descriptionFilePath","field","hasOwnProperty"],"mappings":";;;;;;;;;;;;;;;;;;;IAwPgBA,yBAAyB;eAAzBA;;IA5BAC,uBAAuB;eAAvBA;;IAgDAC,gBAAgB;eAAhBA;;IAtEAC,iCAAiC;eAAjCA;;IA3KAC,oBAAoB;eAApBA;;IAqVAC,yBA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AIO,SAAS7E;IACd,OAAO;QACLiF,SAAShE,QAAQC,OAAO,CAAC;QACzB,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gBAAgBD,QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFgE,KAAKjE,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,gEAAgE;AAChE,SAASoB,6BAA6B6C,QAAkB;IACtD,MAAMC,UAAqC,CAAC;IAC5C,MAAMC,aAAa;QAAC;QAAU;KAAO;IAErC,KAAK,MAAMC,OAAOH,SAAU;QAC1B,IAAI;YACF,MAAMI,sBAAsBtE,QAAQ,GAAGqE,IAAI,aAAa,CAAC;YACzD,MAAME,sBAAsBvE,QAAQC,OAAO,CAAC,GAAGoE,IAAI,aAAa,CAAC;YAEjE,KAAK,MAAMG,SAASJ,WAAY;gBAC9B,IAAIE,oBAAoBG,cAAc,CAACD,QAAQ;oBAC7CL,OAAO,CAACE,MAAM,IAAI,GAAG3D,aAAI,CAACC,IAAI,CAC5BD,aAAI,CAACmB,OAAO,CAAC0C,sBACbD,mBAAmB,CAACE,MAAM;oBAE5B;gBACF;YACF;QACF,EAAE,OAAM,CAAC;IACX;IAEA,OAAOL;AACT;AACA,SAAS/C;IACP,OAAO;QACL,qBAAqB;IACvB;AACF"}
|
package/dist/build/index.js
CHANGED
@@ -368,7 +368,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
368
368
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
369
369
|
buildMode: experimentalBuildMode,
|
370
370
|
isTurboBuild: String(turboNextBuild),
|
371
|
-
version: "15.3.0-canary.
|
371
|
+
version: "15.3.0-canary.8"
|
372
372
|
});
|
373
373
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
374
374
|
_buildcontext.NextBuildContext.dir = dir;
|
@@ -749,7 +749,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
749
749
|
// Files outside of the distDir can be "type": "module"
|
750
750
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
751
751
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
752
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.3.0-canary.
|
752
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.3.0-canary.8");
|
753
753
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
754
754
|
buildStage: 'start'
|
755
755
|
});
|
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.3.0-canary.
|
122
|
+
const nextVersion = "15.3.0-canary.8";
|
123
123
|
const ArchName = (0, _os.arch)();
|
124
124
|
const PlatformName = (0, _os.platform)();
|
125
125
|
function infoLog(...args) {
|
@@ -138,6 +138,7 @@ function getDefineEnv({ isTurbopack, clientRouterFilters, config, dev, distDir,
|
|
138
138
|
'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,
|
139
139
|
'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS': !!config.experimental.authInterrupts,
|
140
140
|
'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(process.env.NEXT_TELEMETRY_DISABLED),
|
141
|
+
'process.env.__NEXT_EXPERIMENTAL_CLIENT_INSTRUMENTATION_HOOK': Boolean(config.experimental.clientInstrumentationHook),
|
141
142
|
...isNodeOrEdgeCompilation ? {
|
142
143
|
// Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)
|
143
144
|
// This is typically found in unmaintained modules from the
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/build/webpack/plugins/define-env-plugin.ts"],"sourcesContent":["import type {\n I18NDomains,\n NextConfigComplete,\n} from '../../../server/config-shared'\nimport type { MiddlewareMatcher } from '../../analysis/get-page-static-info'\nimport { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { needsExperimentalReact } from '../../../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../../../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../../../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../../../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvPluginOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeOrEdgeCompilation: boolean\n isNodeServer: boolean\n middlewareMatchers: MiddlewareMatcher[] | undefined\n omitNonDeterministic?: boolean\n}\n\ninterface DefineEnv {\n [key: string]:\n | string\n | string[]\n | boolean\n | MiddlewareMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = {}\n for (const key in defineEnv) {\n const value = defineEnv[key]\n defineEnvStringified[key] = JSON.stringify(value)\n }\n\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeOrEdgeCompilation,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n}: DefineEnvPluginOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isDynamicIOEnabled = !!config.experimental.dynamicIO\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_DYNAMIC_IO': isDynamicIOEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_SEGMENT_CACHE': Boolean(\n config.experimental.clientSegmentCache\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.middlewarePrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : config.devIndicators.position ?? 'bottom-left',\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_STRICT_NEXT_HEAD':\n config.experimental.strictNextHead ?? true,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipMiddlewareUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalMiddlewareRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeOrEdgeCompilation\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeOrEdgeCompilation\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured via the \\`env\\` option.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n\n return serializedDefineEnv\n}\n\nexport function getDefineEnvPlugin(options: DefineEnvPluginOptions) {\n return new webpack.DefinePlugin(getDefineEnv(options))\n}\n"],"names":["getDefineEnv","getDefineEnvPlugin","serializeDefineEnv","defineEnv","defineEnvStringified","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","path","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","isTurbopack","clientRouterFilters","distDir","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeOrEdgeCompilation","isNodeServer","middlewareMatchers","omitNonDeterministic","nextPublicEnv","getNextPublicEnvironmentVariables","nextConfigEnv","getNextConfigEnv","isPPREnabled","checkIsAppPPREnabled","experimental","ppr","isDynamicIOEnabled","dynamicIO","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","allowDevelopmentBuild","Boolean","appNavFailHandling","deploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","clientSegmentCache","optimisticClientCache","middlewarePrefetch","crossOrigin","__NEXT_TEST_MODE","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","basePath","strictNextHead","i18n","skipMiddlewareUrlNormalize","externalMiddlewareRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","needsExperimentalReact","userDefines","compiler","define","hasOwnProperty","Error","serializedDefineEnv","safeKey","split","pop","options","webpack","DefinePlugin"],"mappings":";;;;;;;;;;;;;;;IA0FgBA,YAAY;eAAZA;;IA4MAC,kBAAkB;eAAlBA;;;yBAjSQ;wCACe;qBACF;2BAI9B;AAwCP;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4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F,sBAAsB/F,mBAAmBC;IAE/C,uDAAuD;IACvD,oDAAoD;IACpD,+BAA+B;IAC/B,IAAI,CAACQ,OAAOuB,sBAAsB;QAChC,qDAAqD;QACrD,qDAAqD;QACrD,mDAAmD;QACnD,MAAMgE,UAAU,CAAC7F,MACfwB,WAAW,CAAC,OAAO,EAAExB,IAAI8F,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAG/F;QAEhD,IAAK,MAAMA,OAAO8B,cAAe;YAC/B8D,mBAAmB,CAAC5F,IAAI,GAAG6F,QAAQ7F;QACrC;QACA,IAAK,MAAMA,OAAOgC,cAAe;YAC/B4D,mBAAmB,CAAC5F,IAAI,GAAG6F,QAAQ7F;QACrC;QACA,KAAK,MAAMA,OAAO;YAAC;SAAiC,CAAE;YACpD4F,mBAAmB,CAAC5F,IAAI,GAAG6F,QAAQ7F;QACrC;IACF;IAEA,OAAO4F;AACT;AAEO,SAAShG,mBAAmBoG,OAA+B;IAChE,OAAO,IAAIC,gBAAO,CAACC,YAAY,CAACvG,aAAaqG;AAC/C"}
|
1
|
+
{"version":3,"sources":["../../../../src/build/webpack/plugins/define-env-plugin.ts"],"sourcesContent":["import type {\n I18NDomains,\n NextConfigComplete,\n} from '../../../server/config-shared'\nimport type { MiddlewareMatcher } from '../../analysis/get-page-static-info'\nimport { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { needsExperimentalReact } from '../../../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../../../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../../../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../../../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvPluginOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeOrEdgeCompilation: boolean\n isNodeServer: boolean\n middlewareMatchers: MiddlewareMatcher[] | undefined\n omitNonDeterministic?: boolean\n}\n\ninterface DefineEnv {\n [key: string]:\n | string\n | string[]\n | boolean\n | MiddlewareMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = {}\n for (const key in defineEnv) {\n const value = defineEnv[key]\n defineEnvStringified[key] = JSON.stringify(value)\n }\n\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeOrEdgeCompilation,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n}: DefineEnvPluginOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isDynamicIOEnabled = !!config.experimental.dynamicIO\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_DYNAMIC_IO': isDynamicIOEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n 'process.env.NEXT_DEPLOYMENT_ID': config.deploymentId || false,\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_SEGMENT_CACHE': Boolean(\n config.experimental.clientSegmentCache\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.middlewarePrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : config.devIndicators.position ?? 'bottom-left',\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_STRICT_NEXT_HEAD':\n config.experimental.strictNextHead ?? true,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipMiddlewareUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalMiddlewareRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n 'process.env.__NEXT_EXPERIMENTAL_CLIENT_INSTRUMENTATION_HOOK': Boolean(\n config.experimental.clientInstrumentationHook\n ),\n ...(isNodeOrEdgeCompilation\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeOrEdgeCompilation\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured via the \\`env\\` option.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n\n return serializedDefineEnv\n}\n\nexport function getDefineEnvPlugin(options: DefineEnvPluginOptions) {\n return new webpack.DefinePlugin(getDefineEnv(options))\n}\n"],"names":["getDefineEnv","getDefineEnvPlugin","serializeDefineEnv","defineEnv","defineEnvStringified","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","path","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","isTurbopack","clientRouterFilters","distDir","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeOrEdgeCompilation","isNodeServer","middlewareMatchers","omitNonDeterministic","nextPublicEnv","getNextPublicEnvironmentVariables","nextConfigEnv","getNextConfigEnv","isPPREnabled","checkIsAppPPREnabled","experimental","ppr","isDynamicIOEnabled","dynamicIO","isUseCacheEnabled","useCache","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","allowDevelopmentBuild","Boolean","appNavFailHandling","deploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","clientSegmentCache","optimisticClientCache","middlewarePrefetch","crossOrigin","__NEXT_TEST_MODE","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","basePath","strictNextHead","i18n","skipMiddlewareUrlNormalize","externalMiddlewareRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","clientInstrumentationHook","undefined","needsExperimentalReact","userDefines","compiler","define","hasOwnProperty","Error","serializedDefineEnv","safeKey","split","pop","options","webpack","DefinePlugin"],"mappings":";;;;;;;;;;;;;;;IA0FgBA,YAAY;eAAZA;;IA+MAC,kBAAkB;eAAlBA;;;yBApSQ;wCACe;qBACF;2BAI9B;AAwCP;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4C,CAAC;IACnD,IAAK,MAAMC,OAAOF,UAAW;QAC3B,MAAMG,QAAQH,SAAS,CAACE,IAAI;QAC5BD,oBAAoB,CAACC,IAAI,GAAGE,KAAKC,SAAS,CAACF;IAC7C;IAEA,OAAOF;AACT;AAEA,SAASK,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;IAdzB,OAAO;QACL,iCAAiC;YAC/BE,aAAaF,OAAOG,MAAM,CAACD,WAAW;YACtCE,YAAYJ,OAAOG,MAAM,CAACC,UAAU;YACpCC,WAAWL,OAAOG,MAAM,CAACE,SAAS;YAClCC,MAAMN,OAAOG,MAAM,CAACG,IAAI;YACxBC,QAAQP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,OAAOgC,cAAe;YAC/B6D,mBAAmB,CAAC7F,IAAI,GAAG8F,QAAQ9F;QACrC;QACA,KAAK,MAAMA,OAAO;YAAC;SAAiC,CAAE;YACpD6F,mBAAmB,CAAC7F,IAAI,GAAG8F,QAAQ9F;QACrC;IACF;IAEA,OAAO6F;AACT;AAEO,SAASjG,mBAAmBqG,OAA+B;IAChE,OAAO,IAAIC,gBAAO,CAACC,YAAY,CAACxG,aAAasG;AAC/C"}
|
@@ -907,11 +907,9 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
907
907
|
} : undefined,
|
908
908
|
minimize: !dev && (isClient || isEdgeServer || isNodeServer && config.experimental.serverMinification),
|
909
909
|
minimizer: isRspack ? [
|
910
|
-
|
911
|
-
new _webpack.webpack.SwcJsMinimizerRspackPlugin({
|
910
|
+
new ((0, _getrspack.getRspackCore)()).SwcJsMinimizerRspackPlugin({
|
912
911
|
}),
|
913
|
-
|
914
|
-
new _webpack.webpack.LightningCssMinimizerRspackPlugin({
|
912
|
+
new ((0, _getrspack.getRspackCore)()).LightningCssMinimizerRspackPlugin({
|
915
913
|
})
|
916
914
|
] : [
|
917
915
|
// Minify JavaScript
|
@@ -1626,7 +1624,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1626
1624
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
1627
1625
|
// file path to build output of `@next/polyfill-nomodule`
|
1628
1626
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1629
|
-
cacheKey: "15.3.0-canary.
|
1627
|
+
cacheKey: "15.3.0-canary.8",
|
1630
1628
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1631
1629
|
minimize: false,
|
1632
1630
|
info: {
|
@@ -1803,7 +1801,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1803
1801
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1804
1802
|
// - Next.js version
|
1805
1803
|
// - next.config.js keys that affect compilation
|
1806
|
-
version: `${__dirname}|${"15.3.0-canary.
|
1804
|
+
version: `${__dirname}|${"15.3.0-canary.8"}|${configVars}`,
|
1807
1805
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
1808
1806
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1809
1807
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|