UNPKG

107 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../build/webpack-config.ts"],"names":["devtoolRevertWarning","devtool","console","warn","chalk","yellow","bold","parseJsonFile","filePath","JSON5","require","contents","trim","parse","err","codeFrame","String","start","line","lineNumber","column","columnNumber","message","highlightCode","Error","getOptimizedAliases","isServer","stubWindowFetch","path","join","__dirname","stubObjectAssign","shimAssign","Object","assign","unfetch$","url","resolve","attachReactRefresh","webpackConfig","targetLoader","injections","reactRefreshLoaderName","reactRefreshLoader","module","rules","forEach","rule","curr","use","Array","isArray","some","r","idx","findIndex","splice","Log","info","WEBPACK_RESOLVE_OPTIONS","dependencyType","symlinks","NODE_RESOLVE_OPTIONS","modules","alias","fallback","exportsFields","importsFields","conditionNames","descriptionFiles","extensions","enforceExtensions","mainFields","mainFiles","roots","fullySpecified","preferRelative","preferAbsolute","restrictions","getBaseWebpackConfig","dir","buildId","config","dev","pagesDir","target","reactProductionProfiling","entrypoints","rewrites","isDevFallback","hasRewrites","beforeFiles","length","afterFiles","hasReactRefresh","reactDomVersion","cwd","name","hasReact18","Boolean","semver","gte","coerce","version","hasReactPrerelease","prerelease","hasReactRoot","experimental","reactRoot","babelConfigFile","reduce","memo","filename","configFilePath","undefined","Promise","distDir","babelLoader","isWebpack5","defaultLoaders","babel","loader","options","configFile","cache","development","hasJsxRuntime","hotSelfAccept","babelIncludeRegexes","nodePathList","process","env","NODE_PATH","split","platform","filter","p","isServerless","isServerlessTrace","isLikeServerless","outputDir","SERVERLESS_DIRECTORY","SERVER_DIRECTORY","outputPath","totalPages","keys","clientEntries","CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH","CLIENT_STATIC_FILES_RUNTIME_AMP","NEXT_PROJECT_ROOT_DIST_CLIENT","replace","CLIENT_STATIC_FILES_RUNTIME_MAIN","relative","CLIENT_STATIC_FILES_RUNTIME_POLYFILLS","typeScriptPath","paths","_","tsConfigPath","useTypeScript","jsConfig","ts","tsConfig","compilerOptions","jsConfigPath","resolvedBaseUrl","baseUrl","getReactProfilingInProduction","clientResolveRewrites","clientResolveRewritesNoop","resolveConfig","next","NEXT_PROJECT_ROOT","PAGES_DIR_ALIAS","DOT_NEXT_ALIAS","assert","buffer","constants","crypto","domain","http","https","os","punycode","querystring","stream","string_decoder","sys","timers","tty","util","vm","zlib","plugins","terserOptions","ecma","compress","warnings","comparisons","inline","mangle","safari10","output","comments","ascii_only","isModuleCSS","type","splitChunksConfigs","cacheGroups","default","vendors","prodGranular","chunks","chunk","test","framework","priority","enforce","lib","size","nameForCondition","hash","createHash","updateHash","libIdent","update","context","digest","substring","minChunks","reuseExistingChunk","commons","shared","acc","maxInitialRequests","minSize","splitChunksConfig","crossOrigin","customAppFile","pageExtensions","conformanceConfig","ReactSyncScriptsConformanceCheck","enabled","MinificationConformanceCheck","DuplicatePolyfillsConformanceCheck","BlockedAPIToBePolyfilled","conformance","GranularChunksConformanceCheck","handleExternals","request","getResolve","isLocal","startsWith","posix","isAbsolute","win32","notExternalModules","res","isNextExternal","externalRequest","baseRes","baseResolve","match","emacsLockfilePattern","externals","callback","resolveContext","requestToResolve","then","result","optimizeCss","optimization","emitOnErrors","noEmitOnErrors","checkWasmTypes","nodeEnv","splitChunks","runtimeChunk","CLIENT_STATIC_FILES_RUNTIME_WEBPACK","minimize","minimizer","compiler","TerserPlugin","cacheDir","parallel","cpus","apply","CssMinimizerPlugin","postcssOptions","map","annotation","node","setImmediate","entry","watchOptions","aggregateTimeout","ignored","environment","arrowFunction","bigIntLiteral","const","destructuring","dynamicImport","forOf","publicPath","assetPrefix","library","libraryTarget","hotUpdateChunkFilename","hotUpdateMainFilename","chunkFilename","strictModuleExceptionHandling","crossOriginLoading","futureEmitAssets","webassemblyModuleFilename","performance","resolveLoader","externalDir","include","exclude","excludePath","ReactRefreshWebpackPlugin","webpack","ProvidePlugin","Buffer","ChunkNamesPlugin","DefinePlugin","prev","key","JSON","stringify","__NEXT_TEST_MODE","trailingSlash","devIndicators","buildActivity","reactStrictMode","optimizeFonts","optimizeImages","scrollRestoration","deviceSizes","images","imageSizes","domains","basePath","i18n","analyticsId","pageEnv","ReactLoadablePlugin","REACT_LOADABLE_MANIFEST","DropClientPage","excludeDefaultMomentLocales","IgnorePlugin","resourceRegExp","contextRegExp","NextJsRequireCacheHotReloader","devPlugins","push","HotModuleReplacementPlugin","HashedModuleIdsPlugin","ServerlessPlugin","PagesManifestPlugin","serverless","NextJsSSRModuleCachePlugin","NextJsSsrImportPlugin","BuildManifestPlugin","stats","BuildStatsPlugin","ProfilingPlugin","FontStylesheetGatheringPlugin","WebpackConformancePlugin","tests","AllowedSources","allowedSources","WellKnownErrorsPlugin","unshift","JsConfigPathsPlugin","dependencies","snapshot","versions","pnp","exec","managedPaths","immutablePaths","providedExports","usedExports","configVars","reactMode","disableOptimizedLoading","__NEXT_VERSION","cacheDirectory","buildDependencies","NEXT_WEBPACK_LOGGING","logInfra","includes","logProfileClient","logProfileServer","logDefault","infrastructureLogging","level","debug","hooks","done","tap","log","toString","colors","logging","ProgressPlugin","profile","rootDirectory","isDevelopment","sassOptions","productionBrowserSourceMaps","future","isCraCompat","craCompat","originalDevtool","disableStaticImages","hasSvg","RegExp","dependency","not","issuer","regexLikeCss","fileLoaderExclude","fileLoader","generator","topRules","innerRules","oneOf","resource","webpackDevMiddleware","canMatchCss","fileNames","input","hasUserCssConfig","__next_css_remove","e","strictPostcssConfiguration","foundTsRule","call","isSass","source","isLess","isCss","isStylus","prototype","hasOwnProperty","correctNextCss","correctCssLoader","originalEntry","updatedEntry","originalFile","dependOn","old","import"],"mappings":"wHAAA,sHACA,oDACA,sDACA,sBACA,8DACA,yEACA,2DACA,mDACA,2CAMA,8CACA,6DAEA,wFACA,wDAUA,+CAEA,0DAEA,yDACA,wCACA,8FACA,oGACA,8FACA,8FACA,4EACA,wFACA,4FACA,uGACA,oGACA,mEACA,4EACA,qEACA,+GAMA,gFACA,gD,w4BAIA,KAAMA,CAAAA,oBAAoB,CAAG,oBAC1BC,OAAD,EAA+C,C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I,GAAK,WAAT,EACAA,IAAI,GAAK,MADT,EAEAA,IAAI,GAAK,KAFT,EAGAA,IAAI,GAAK,eAJX,CAME,SACF,KAAMmW,CAAAA,QAAQ,CACZnW,IAAI,CAAC0J,UAAL,CAAgB,QAAhB,GAA6B1J,IAAI,GAAK,YAAtC,CACI,YADJ,CAEI,MAHN,CAIA,KAAMoW,CAAAA,GAAG,CAAGjK,KAAK,CAACnM,IAAD,CAAjB,CACA,GAAI,MAAOoW,CAAAA,GAAP,GAAe,QAAf,EAA2B,CAACnZ,KAAK,CAACC,OAAN,CAAckZ,GAAd,CAAhC,CAAoD,CAClDjK,KAAK,CAACnM,IAAD,CAAL,CAAc,CACZmW,QADY,CAEZ,GAAGC,GAFS,CAAd,CAID,CALD,IAKO,CACLjK,KAAK,CAACnM,IAAD,CAAL,CAAc,CACZqW,MAAM,CAAED,GADI,CAEZD,QAFY,CAAd,CAID,CACF,CACF,CAED,MAAOhK,CAAAA,KAAP,CACD,CAlDD,CAmDA;AACA7P,aAAa,CAAC6P,KAAd,CAAsB8J,YAAtB,CACD,CAED,GAAI,CAAC/W,GAAL,CAAU,CACR;AACA5C,aAAa,CAAC6P,KAAd,CAAsB,KAAO7P,CAAAA,aAAa,CAAC6P,KAAf,EAA5B,CACD,CAED,MAAO7P,CAAAA,aAAP,CACD","sourcesContent":["import ReactRefreshWebpackPlugin from '@next/react-refresh-utils/ReactRefreshWebpackPlugin'\nimport chalk from 'chalk'\nimport crypto from 'crypto'\nimport { readFileSync } from 'fs'\nimport { codeFrameColumns } from 'next/dist/compiled/babel/code-frame'\nimport semver from 'next/dist/compiled/semver'\nimport { isWebpack5, webpack } from 'next/dist/compiled/webpack/webpack'\nimport path, { join as pathJoin, relative as relativePath } from 'path'\nimport {\n DOT_NEXT_ALIAS,\n NEXT_PROJECT_ROOT,\n NEXT_PROJECT_ROOT_DIST_CLIENT,\n PAGES_DIR_ALIAS,\n} from '../lib/constants'\nimport { fileExists } from '../lib/file-exists'\nimport { getPackageVersion } from '../lib/get-package-version'\nimport { CustomRoutes } from '../lib/load-custom-routes.js'\nimport { getTypeScriptConfiguration } from '../lib/typescript/getTypeScriptConfiguration'\nimport {\n CLIENT_STATIC_FILES_RUNTIME_AMP,\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_POLYFILLS,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_WEBPACK,\n REACT_LOADABLE_MANIFEST,\n SERVERLESS_DIRECTORY,\n SERVER_DIRECTORY,\n} from '../next-server/lib/constants'\nimport { execOnce } from '../next-server/lib/utils'\nimport { NextConfig } from '../next-server/server/config'\nimport { findPageFile } from '../server/lib/find-page-file'\nimport { WebpackEntrypoints } from './entries'\nimport * as Log from './output/log'\nimport { build as buildConfiguration } from './webpack/config'\nimport { __overrideCssConfiguration } from './webpack/config/blocks/css/overrideCssConfiguration'\nimport BuildManifestPlugin from './webpack/plugins/build-manifest-plugin'\nimport BuildStatsPlugin from './webpack/plugins/build-stats-plugin'\nimport ChunkNamesPlugin from './webpack/plugins/chunk-names-plugin'\nimport { JsConfigPathsPlugin } from './webpack/plugins/jsconfig-paths-plugin'\nimport { DropClientPage } from './webpack/plugins/next-drop-client-page-plugin'\nimport NextJsSsrImportPlugin from './webpack/plugins/nextjs-ssr-import'\nimport NextJsSSRModuleCachePlugin from './webpack/plugins/nextjs-ssr-module-cache'\nimport PagesManifestPlugin from './webpack/plugins/pages-manifest-plugin'\nimport { ProfilingPlugin } from './webpack/plugins/profiling-plugin'\nimport { ReactLoadablePlugin } from './webpack/plugins/react-loadable-plugin'\nimport { ServerlessPlugin } from './webpack/plugins/serverless-plugin'\nimport WebpackConformancePlugin, {\n DuplicatePolyfillsConformanceCheck,\n GranularChunksConformanceCheck,\n MinificationConformanceCheck,\n ReactSyncScriptsConformanceCheck,\n} from './webpack/plugins/webpack-conformance-plugin'\nimport { WellKnownErrorsPlugin } from './webpack/plugins/wellknown-errors-plugin'\nimport { regexLikeCss } from './webpack/config/blocks/css'\n\ntype ExcludesFalse = <T>(x: T | false) => x is T\n\nconst devtoolRevertWarning = execOnce(\n (devtool: webpack.Configuration['devtool']) => {\n console.warn(\n chalk.yellow.bold('Warning: ') +\n chalk.bold(`Reverting webpack devtool to '${devtool}'.\\n`) +\n 'Changing the webpack devtool in development mode will cause severe performance regressions.\\n' +\n 'Read more: https://nextjs.org/docs/messages/improper-devtool'\n )\n }\n)\n\nfunction parseJsonFile(filePath: string) {\n const JSON5 = require('next/dist/compiled/json5')\n const contents = readFileSync(filePath, 'utf8')\n\n // Special case an empty file\n if (contents.trim() === '') {\n return {}\n }\n\n try {\n return JSON5.parse(contents)\n } catch (err) {\n const codeFrame = codeFrameColumns(\n String(contents),\n { start: { line: err.lineNumber, column: err.columnNumber } },\n { message: err.message, highlightCode: true }\n )\n throw new Error(`Failed to parse \"${filePath}\":\\n${codeFrame}`)\n }\n}\n\nfunction getOptimizedAliases(isServer: boolean): { [pkg: string]: string } {\n if (isServer) {\n return {}\n }\n\n const stubWindowFetch = path.join(__dirname, 'polyfills', 'fetch', 'index.js')\n const stubObjectAssign = path.join(__dirname, 'polyfills', 'object-assign.js')\n\n const shimAssign = path.join(__dirname, 'polyfills', 'object.assign')\n return Object.assign(\n {},\n {\n unfetch$: stubWindowFetch,\n 'isomorphic-unfetch$': stubWindowFetch,\n 'whatwg-fetch$': path.join(\n __dirname,\n 'polyfills',\n 'fetch',\n 'whatwg-fetch.js'\n ),\n },\n {\n 'object-assign$': stubObjectAssign,\n\n // Stub Package: object.assign\n 'object.assign/auto': path.join(shimAssign, 'auto.js'),\n 'object.assign/implementation': path.join(\n shimAssign,\n 'implementation.js'\n ),\n 'object.assign$': path.join(shimAssign, 'index.js'),\n 'object.assign/polyfill': path.join(shimAssign, 'polyfill.js'),\n 'object.assign/shim': path.join(shimAssign, 'shim.js'),\n\n // Replace: full URL polyfill with platform-based polyfill\n url: require.resolve('native-url'),\n }\n )\n}\n\ntype ClientEntries = {\n [key: string]: string | string[]\n}\n\nexport function attachReactRefresh(\n webpackConfig: webpack.Configuration,\n targetLoader: webpack.RuleSetUseItem\n) {\n let injections = 0\n const reactRefreshLoaderName = '@next/react-refresh-utils/loader'\n const reactRefreshLoader = require.resolve(reactRefreshLoaderName)\n webpackConfig.module?.rules.forEach((rule) => {\n const curr = rule.use\n // When the user has configured `defaultLoaders.babel` for a input file:\n if (curr === targetLoader) {\n ++injections\n rule.use = [reactRefreshLoader, curr as webpack.RuleSetUseItem]\n } else if (\n Array.isArray(curr) &&\n curr.some((r) => r === targetLoader) &&\n // Check if loader already exists:\n !curr.some(\n (r) => r === reactRefreshLoader || r === reactRefreshLoaderName\n )\n ) {\n ++injections\n const idx = curr.findIndex((r) => r === targetLoader)\n // Clone to not mutate user input\n rule.use = [...curr]\n\n // inject / input: [other, babel] output: [other, refresh, babel]:\n rule.use.splice(idx, 0, reactRefreshLoader)\n }\n })\n\n if (injections) {\n Log.info(\n `automatically enabled Fast Refresh for ${injections} custom loader${\n injections > 1 ? 's' : ''\n }`\n )\n }\n}\n\nconst WEBPACK_RESOLVE_OPTIONS = {\n // This always uses commonjs resolving, assuming API is identical\n // between ESM and CJS in a package\n // Otherwise combined ESM+CJS packages will never be external\n // as resolving mismatch would lead to opt-out from being external.\n dependencyType: 'commonjs',\n symlinks: true,\n}\n\nconst NODE_RESOLVE_OPTIONS = {\n dependencyType: 'commonjs',\n modules: ['node_modules'],\n alias: false,\n fallback: false,\n exportsFields: ['exports'],\n importsFields: ['imports'],\n conditionNames: ['node', 'require', 'module'],\n descriptionFiles: ['package.json'],\n extensions: ['.js', '.json', '.node'],\n enforceExtensions: false,\n symlinks: true,\n mainFields: ['main'],\n mainFiles: ['index'],\n roots: [],\n fullySpecified: false,\n preferRelative: false,\n preferAbsolute: false,\n restrictions: [],\n}\n\nexport default async function getBaseWebpackConfig(\n dir: string,\n {\n buildId,\n config,\n dev = false,\n isServer = false,\n pagesDir,\n target = 'server',\n reactProductionProfiling = false,\n entrypoints,\n rewrites,\n isDevFallback = false,\n }: {\n buildId: string\n config: NextConfig\n dev?: boolean\n isServer?: boolean\n pagesDir: string\n target?: string\n reactProductionProfiling?: boolean\n entrypoints: WebpackEntrypoints\n rewrites: CustomRoutes['rewrites']\n isDevFallback?: boolean\n }\n): Promise<webpack.Configuration> {\n const hasRewrites =\n rewrites.beforeFiles.length > 0 ||\n rewrites.afterFiles.length > 0 ||\n rewrites.fallback.length > 0\n const hasReactRefresh: boolean = dev && !isServer\n const reactDomVersion = await getPackageVersion({\n cwd: dir,\n name: 'react-dom',\n })\n const hasReact18: boolean =\n Boolean(reactDomVersion) &&\n (semver.gte(reactDomVersion!, '18.0.0') ||\n semver.coerce(reactDomVersion)?.version === '18.0.0')\n const hasReactPrerelease =\n Boolean(reactDomVersion) && semver.prerelease(reactDomVersion!) != null\n const hasReactRoot: boolean = config.experimental.reactRoot || hasReact18\n\n // Only inform during one of the builds\n if (!isServer) {\n if (hasReactRoot) {\n Log.info('Using the createRoot API for React')\n }\n if (hasReactPrerelease) {\n Log.warn(\n `You are using an unsupported prerelease of 'react-dom' which may cause ` +\n `unexpected or broken application behavior. Continue at your own risk.`\n )\n }\n }\n\n const babelConfigFile = await [\n '.babelrc',\n '.babelrc.json',\n '.babelrc.js',\n '.babelrc.mjs',\n '.babelrc.cjs',\n 'babel.config.js',\n 'babel.config.json',\n 'babel.config.mjs',\n 'babel.config.cjs',\n ].reduce(async (memo: Promise<string | undefined>, filename) => {\n const configFilePath = path.join(dir, filename)\n return (\n (await memo) ||\n ((await fileExists(configFilePath)) ? configFilePath : undefined)\n )\n }, Promise.resolve(undefined))\n\n const distDir = path.join(dir, config.distDir)\n\n // Webpack 5 can use the faster babel loader, webpack 5 has built-in caching for loaders\n // For webpack 4 the old loader is used as it has external caching\n const babelLoader = isWebpack5\n ? require.resolve('./babel/loader/index')\n : 'next-babel-loader'\n const defaultLoaders = {\n babel: {\n loader: babelLoader,\n options: {\n configFile: babelConfigFile,\n isServer,\n distDir,\n pagesDir,\n cwd: dir,\n // Webpack 5 has a built-in loader cache\n cache: !isWebpack5,\n development: dev,\n hasReactRefresh,\n hasJsxRuntime: true,\n },\n },\n // Backwards compat\n hotSelfAccept: {\n loader: 'noop-loader',\n },\n }\n\n const babelIncludeRegexes: RegExp[] = [\n /next[\\\\/]dist[\\\\/]next-server[\\\\/]lib/,\n /next[\\\\/]dist[\\\\/]client/,\n /next[\\\\/]dist[\\\\/]pages/,\n /[\\\\/](strip-ansi|ansi-regex)[\\\\/]/,\n ]\n\n // Support for NODE_PATH\n const nodePathList = (process.env.NODE_PATH || '')\n .split(process.platform === 'win32' ? ';' : ':')\n .filter((p) => !!p)\n\n const isServerless = target === 'serverless'\n const isServerlessTrace = target === 'experimental-serverless-trace'\n // Intentionally not using isTargetLikeServerless helper\n const isLikeServerless = isServerless || isServerlessTrace\n\n const outputDir = isLikeServerless ? SERVERLESS_DIRECTORY : SERVER_DIRECTORY\n const outputPath = path.join(distDir, isServer ? outputDir : '')\n const totalPages = Object.keys(entrypoints).length\n const clientEntries = !isServer\n ? ({\n // Backwards compatibility\n 'main.js': [],\n ...(dev\n ? {\n [CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH]: require.resolve(\n `@next/react-refresh-utils/runtime`\n ),\n [CLIENT_STATIC_FILES_RUNTIME_AMP]:\n `./` +\n relativePath(\n dir,\n pathJoin(NEXT_PROJECT_ROOT_DIST_CLIENT, 'dev', 'amp-dev')\n ).replace(/\\\\/g, '/'),\n }\n : {}),\n [CLIENT_STATIC_FILES_RUNTIME_MAIN]:\n `./` +\n path\n .relative(\n dir,\n path.join(\n NEXT_PROJECT_ROOT_DIST_CLIENT,\n dev ? `next-dev.js` : 'next.js'\n )\n )\n .replace(/\\\\/g, '/'),\n [CLIENT_STATIC_FILES_RUNTIME_POLYFILLS]: path.join(\n NEXT_PROJECT_ROOT_DIST_CLIENT,\n 'polyfills.js'\n ),\n } as ClientEntries)\n : undefined\n\n let typeScriptPath: string | undefined\n try {\n typeScriptPath = require.resolve('typescript', { paths: [dir] })\n } catch (_) {}\n const tsConfigPath = path.join(dir, 'tsconfig.json')\n const useTypeScript = Boolean(\n typeScriptPath && (await fileExists(tsConfigPath))\n )\n\n let jsConfig\n // jsconfig is a subset of tsconfig\n if (useTypeScript) {\n const ts = (await import(typeScriptPath!)) as typeof import('typescript')\n const tsConfig = await getTypeScriptConfiguration(ts, tsConfigPath, true)\n jsConfig = { compilerOptions: tsConfig.options }\n }\n\n const jsConfigPath = path.join(dir, 'jsconfig.json')\n if (!useTypeScript && (await fileExists(jsConfigPath))) {\n jsConfig = parseJsonFile(jsConfigPath)\n }\n\n let resolvedBaseUrl\n if (jsConfig?.compilerOptions?.baseUrl) {\n resolvedBaseUrl = path.resolve(dir, jsConfig.compilerOptions.baseUrl)\n }\n\n function getReactProfilingInProduction() {\n if (reactProductionProfiling) {\n return {\n 'react-dom$': 'react-dom/profiling',\n 'scheduler/tracing': 'scheduler/tracing-profiling',\n }\n }\n }\n\n const clientResolveRewrites = require.resolve(\n '../next-server/lib/router/utils/resolve-rewrites'\n )\n const clientResolveRewritesNoop = require.resolve(\n '../next-server/lib/router/utils/resolve-rewrites-noop'\n )\n\n const resolveConfig = {\n // Disable .mjs for node_modules bundling\n extensions: isServer\n ? [\n '.js',\n '.mjs',\n ...(useTypeScript ? ['.tsx', '.ts'] : []),\n '.jsx',\n '.json',\n '.wasm',\n ]\n : [\n '.mjs',\n '.js',\n ...(useTypeScript ? ['.tsx', '.ts'] : []),\n '.jsx',\n '.json',\n '.wasm',\n ],\n modules: [\n 'node_modules',\n ...nodePathList, // Support for NODE_PATH environment variable\n ],\n alias: {\n next: NEXT_PROJECT_ROOT,\n [PAGES_DIR_ALIAS]: pagesDir,\n [DOT_NEXT_ALIAS]: distDir,\n ...getOptimizedAliases(isServer),\n ...getReactProfilingInProduction(),\n [clientResolveRewrites]: hasRewrites\n ? clientResolveRewrites\n : // With webpack 5 an alias can be pointed to false to noop\n isWebpack5\n ? false\n : clientResolveRewritesNoop,\n },\n ...(isWebpack5 && !isServer\n ? {\n // Full list of old polyfills is accessible here:\n // https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42\n fallback: {\n assert: require.resolve('assert/'),\n buffer: require.resolve('buffer/'),\n constants: require.resolve('constants-browserify'),\n crypto: require.resolve('crypto-browserify'),\n domain: require.resolve('domain-browser'),\n http: require.resolve('stream-http'),\n https: require.resolve('https-browserify'),\n os: require.resolve('os-browserify/browser'),\n path: require.resolve('path-browserify'),\n punycode: require.resolve('punycode'),\n process: require.resolve('process/browser'),\n // Handled in separate alias\n querystring: require.resolve('querystring-es3'),\n stream: require.resolve('stream-browserify'),\n string_decoder: require.resolve('string_decoder'),\n sys: require.resolve('util/'),\n timers: require.resolve('timers-browserify'),\n tty: require.resolve('tty-browserify'),\n // Handled in separate alias\n // url: require.resolve('url/'),\n util: require.resolve('util/'),\n vm: require.resolve('vm-browserify'),\n zlib: require.resolve('browserify-zlib'),\n },\n }\n : undefined),\n mainFields: isServer ? ['main', 'module'] : ['browser', 'module', 'main'],\n plugins: isWebpack5\n ? // webpack 5+ has the PnP resolver built-in by default:\n []\n : [require('pnp-webpack-plugin')],\n }\n\n const terserOptions: any = {\n parse: {\n ecma: 8,\n },\n compress: {\n ecma: 5,\n warnings: false,\n // The following two options are known to break valid JavaScript code\n comparisons: false,\n inline: 2, // https://github.com/vercel/next.js/issues/7178#issuecomment-493048965\n },\n mangle: { safari10: true },\n output: {\n ecma: 5,\n safari10: true,\n comments: false,\n // Fixes usage of Emoji and certain Regex\n ascii_only: true,\n },\n }\n\n const isModuleCSS = (module: { type: string }): boolean => {\n return (\n // mini-css-extract-plugin\n module.type === `css/mini-extract` ||\n // extract-css-chunks-webpack-plugin (old)\n module.type === `css/extract-chunks` ||\n // extract-css-chunks-webpack-plugin (new)\n module.type === `css/extract-css-chunks`\n )\n }\n\n // Contains various versions of the Webpack SplitChunksPlugin used in different build types\n const splitChunksConfigs: {\n [propName: string]: webpack.Options.SplitChunksOptions | false\n } = {\n dev: {\n cacheGroups: {\n default: false,\n vendors: false,\n },\n },\n prodGranular: {\n // Keep main and _app chunks unsplitted in webpack 5\n // as we don't need a separate vendor chunk from that\n // and all other chunk depend on them so there is no\n // duplication that need to be pulled out.\n chunks: isWebpack5\n ? (chunk) => !/^(polyfills|main|pages\\/_app)$/.test(chunk.name)\n : 'all',\n cacheGroups: {\n framework: {\n chunks: 'all',\n name: 'framework',\n // This regex ignores nested copies of framework libraries so they're\n // bundled with their issuer.\n // https://github.com/vercel/next.js/pull/9012\n test: /(?<!node_modules.*)[\\\\/]node_modules[\\\\/](react|react-dom|scheduler|prop-types|use-subscription)[\\\\/]/,\n priority: 40,\n // Don't let webpack eliminate this chunk (prevents this chunk from\n // becoming a part of the commons chunk)\n enforce: true,\n },\n lib: {\n test(module: {\n size: Function\n nameForCondition: Function\n }): boolean {\n return (\n module.size() > 160000 &&\n /node_modules[/\\\\]/.test(module.nameForCondition() || '')\n )\n },\n name(module: {\n type: string\n libIdent?: Function\n updateHash: (hash: crypto.Hash) => void\n }): string {\n const hash = crypto.createHash('sha1')\n if (isModuleCSS(module)) {\n module.updateHash(hash)\n } else {\n if (!module.libIdent) {\n throw new Error(\n `Encountered unknown module type: ${module.type}. Please open an issue.`\n )\n }\n\n hash.update(module.libIdent({ context: dir }))\n }\n\n return hash.digest('hex').substring(0, 8)\n },\n priority: 30,\n minChunks: 1,\n reuseExistingChunk: true,\n },\n commons: {\n name: 'commons',\n minChunks: totalPages,\n priority: 20,\n },\n ...(isWebpack5\n ? undefined\n : {\n default: false,\n vendors: false,\n shared: {\n name(module, chunks) {\n return (\n crypto\n .createHash('sha1')\n .update(\n chunks.reduce(\n (acc: string, chunk: webpack.compilation.Chunk) => {\n return acc + chunk.name\n },\n ''\n )\n )\n .digest('hex') + (isModuleCSS(module) ? '_CSS' : '')\n )\n },\n priority: 10,\n minChunks: 2,\n reuseExistingChunk: true,\n },\n }),\n },\n maxInitialRequests: 25,\n minSize: 20000,\n },\n }\n\n // Select appropriate SplitChunksPlugin config for this build\n let splitChunksConfig: webpack.Options.SplitChunksOptions | false\n if (dev) {\n splitChunksConfig = isWebpack5 ? false : splitChunksConfigs.dev\n } else {\n splitChunksConfig = splitChunksConfigs.prodGranular\n }\n\n const crossOrigin = config.crossOrigin\n\n let customAppFile: string | null = await findPageFile(\n pagesDir,\n '/_app',\n config.pageExtensions\n )\n if (customAppFile) {\n customAppFile = path.resolve(path.join(pagesDir, customAppFile))\n }\n\n const conformanceConfig = Object.assign(\n {\n ReactSyncScriptsConformanceCheck: {\n enabled: true,\n },\n MinificationConformanceCheck: {\n enabled: true,\n },\n DuplicatePolyfillsConformanceCheck: {\n enabled: true,\n BlockedAPIToBePolyfilled: Object.assign(\n [],\n ['fetch'],\n config.conformance?.DuplicatePolyfillsConformanceCheck\n ?.BlockedAPIToBePolyfilled || []\n ),\n },\n GranularChunksConformanceCheck: {\n enabled: true,\n },\n },\n config.conformance\n )\n\n async function handleExternals(\n context: string,\n request: string,\n getResolve: (\n options: any\n ) => (resolveContext: string, resolveRequest: string) => Promise<string>\n ) {\n // We need to externalize internal requests for files intended to\n // not be bundled.\n\n const isLocal: boolean =\n request.startsWith('.') ||\n // Always check for unix-style path, as webpack sometimes\n // normalizes as posix.\n path.posix.isAbsolute(request) ||\n // When on Windows, we also want to check for Windows-specific\n // absolute paths.\n (process.platform === 'win32' && path.win32.isAbsolute(request))\n\n // Relative requires don't need custom resolution, because they\n // are relative to requests we've already resolved here.\n // Absolute requires (require('/foo')) are extremely uncommon, but\n // also have no need for customization as they're already resolved.\n if (isLocal) {\n if (!/[/\\\\]next-server[/\\\\]/.test(request)) {\n return\n }\n } else {\n if (/^(?:next$|react(?:$|\\/))/.test(request)) {\n return `commonjs ${request}`\n }\n\n const notExternalModules = /^(?:private-next-pages\\/|next\\/(?:dist\\/pages\\/|(?:app|document|link|image|constants)$)|string-hash$)/\n if (notExternalModules.test(request)) {\n return\n }\n }\n\n const resolve = getResolve(WEBPACK_RESOLVE_OPTIONS)\n\n // Resolve the import with the webpack provided context, this\n // ensures we're resolving the correct version when multiple\n // exist.\n let res: string\n try {\n res = await resolve(context, request)\n } catch (err) {\n // If the request cannot be resolved, we need to tell webpack to\n // \"bundle\" it so that webpack shows an error (that it cannot be\n // resolved).\n return\n }\n\n // Same as above, if the request cannot be resolved we need to have\n // webpack \"bundle\" it so it surfaces the not found error.\n if (!res) {\n return\n }\n\n if (isLocal) {\n // we need to process next-server/lib/router/router so that\n // the DefinePlugin can inject process.env values\n const isNextExternal = /next[/\\\\]dist[/\\\\]next-server[/\\\\](?!lib[/\\\\]router[/\\\\]router)/.test(\n res\n )\n\n if (isNextExternal) {\n // Generate Next.js external import\n const externalRequest = path.posix.join(\n 'next',\n 'dist',\n path\n .relative(\n // Root of Next.js package:\n path.join(__dirname, '..'),\n res\n )\n // Windows path normalization\n .replace(/\\\\/g, '/')\n )\n return `commonjs ${externalRequest}`\n } else {\n return\n }\n }\n\n // Bundled Node.js code is relocated without its node_modules tree.\n // This means we need to make sure its request resolves to the same\n // package that'll be available at runtime. If it's not identical,\n // we need to bundle the code (even if it _should_ be external).\n let baseRes: string | null\n try {\n const baseResolve = getResolve(NODE_RESOLVE_OPTIONS)\n baseRes = await baseResolve(dir, request)\n } catch (err) {\n baseRes = null\n }\n\n // Same as above: if the package, when required from the root,\n // would be different from what the real resolution would use, we\n // cannot externalize it.\n // if res or baseRes are symlinks they could point to the the same file,\n // but the resolver will resolve symlinks so this is already handled\n if (baseRes !== res) {\n return\n }\n\n if (\n res.match(\n /next[/\\\\]dist[/\\\\]next-server[/\\\\](?!lib[/\\\\]router[/\\\\]router)/\n )\n ) {\n return `commonjs ${request}`\n }\n\n // Default pages have to be transpiled\n if (\n res.match(/[/\\\\]next[/\\\\]dist[/\\\\]/) ||\n // This is the @babel/plugin-transform-runtime \"helpers: true\" option\n res.match(/node_modules[/\\\\]@babel[/\\\\]runtime[/\\\\]/)\n ) {\n return\n }\n\n // Webpack itself has to be compiled because it doesn't always use module relative paths\n if (\n res.match(/node_modules[/\\\\]webpack/) ||\n res.match(/node_modules[/\\\\]css-loader/)\n ) {\n return\n }\n\n // Anything else that is standard JavaScript within `node_modules`\n // can be externalized.\n if (/node_modules[/\\\\].*\\.c?js$/.test(res)) {\n return `commonjs ${request}`\n }\n\n // Default behavior: bundle the code!\n }\n\n const emacsLockfilePattern = '**/.#*'\n\n let webpackConfig: webpack.Configuration = {\n externals: !isServer\n ? // make sure importing \"next\" is handled gracefully for client\n // bundles in case a user imported types and it wasn't removed\n // TODO: should we warn/error for this instead?\n ['next']\n : !isServerless\n ? [\n isWebpack5\n ? ({\n context,\n request,\n getResolve,\n }: {\n context: string\n request: string\n getResolve: (\n options: any\n ) => (\n resolveContext: string,\n resolveRequest: string\n ) => Promise<string>\n }) => handleExternals(context, request, getResolve)\n : (\n context: string,\n request: string,\n callback: (err?: Error, result?: string | undefined) => void\n ) =>\n handleExternals(\n context,\n request,\n () => (resolveContext: string, requestToResolve: string) =>\n new Promise((resolve) =>\n resolve(\n require.resolve(requestToResolve, {\n paths: [resolveContext],\n })\n )\n )\n ).then((result) => callback(undefined, result), callback),\n ]\n : [\n // When the 'serverless' target is used all node_modules will be compiled into the output bundles\n // So that the 'serverless' bundles have 0 runtime dependencies\n 'next/dist/compiled/@ampproject/toolbox-optimizer', // except this one\n\n // Mark this as external if not enabled so it doesn't cause a\n // webpack error from being missing\n ...(config.experimental.optimizeCss ? [] : ['critters']),\n ],\n optimization: {\n // Webpack 5 uses a new property for the same functionality\n ...(isWebpack5 ? { emitOnErrors: !dev } : { noEmitOnErrors: dev }),\n checkWasmTypes: false,\n nodeEnv: false,\n splitChunks: isServer\n ? isWebpack5 && !dev\n ? ({\n filename: '[name].js',\n // allow to split entrypoints\n chunks: 'all',\n // size of files is not so relevant for server build\n // we want to prefer deduplication to load less code\n minSize: 1000,\n } as any)\n : false\n : splitChunksConfig,\n runtimeChunk: isServer\n ? isWebpack5 && !isLikeServerless\n ? { name: 'webpack-runtime' }\n : undefined\n : { name: CLIENT_STATIC_FILES_RUNTIME_WEBPACK },\n minimize: !(dev || isServer),\n minimizer: [\n // Minify JavaScript\n (compiler: webpack.Compiler) => {\n // @ts-ignore No typings yet\n const {\n TerserPlugin,\n } = require('./webpack/plugins/terser-webpack-plugin/src/index.js')\n new TerserPlugin({\n cacheDir: path.join(distDir, 'cache', 'next-minifier'),\n parallel: config.experimental.cpus,\n terserOptions,\n }).apply(compiler)\n },\n // Minify CSS\n (compiler: webpack.Compiler) => {\n const {\n CssMinimizerPlugin,\n } = require('./webpack/plugins/css-minimizer-plugin')\n new CssMinimizerPlugin({\n postcssOptions: {\n map: {\n // `inline: false` generates the source map in a separate file.\n // Otherwise, the CSS file is needlessly large.\n inline: false,\n // `annotation: false` skips appending the `sourceMappingURL`\n // to the end of the CSS file. Webpack already handles this.\n annotation: false,\n },\n },\n }).apply(compiler)\n },\n ],\n },\n context: dir,\n node: {\n setImmediate: false,\n },\n // Kept as function to be backwards compatible\n // @ts-ignore TODO webpack 5 typings needed\n entry: async () => {\n return {\n ...(clientEntries ? clientEntries : {}),\n ...entrypoints,\n }\n },\n watchOptions: {\n aggregateTimeout: 5,\n ignored: [\n '**/.git/**',\n '**/node_modules/**',\n '**/.next/**',\n // can be removed after https://github.com/paulmillr/chokidar/issues/955 is released\n emacsLockfilePattern,\n ],\n },\n output: {\n ...(isWebpack5\n ? {\n environment: {\n arrowFunction: false,\n bigIntLiteral: false,\n const: false,\n destructuring: false,\n dynamicImport: false,\n forOf: false,\n module: false,\n },\n }\n : {}),\n // we must set publicPath to an empty value to override the default of\n // auto which doesn't work in IE11\n publicPath: `${config.assetPrefix || ''}/_next/`,\n path:\n isServer && isWebpack5 && !dev\n ? path.join(outputPath, 'chunks')\n : outputPath,\n // On the server we don't use hashes\n filename: isServer\n ? isWebpack5 && !dev\n ? '../[name].js'\n : '[name].js'\n : `static/chunks/${isDevFallback ? 'fallback/' : ''}[name]${\n dev ? '' : isWebpack5 ? '-[contenthash]' : '-[chunkhash]'\n }.js`,\n library: isServer ? undefined : '_N_E',\n libraryTarget: isServer ? 'commonjs2' : 'assign',\n hotUpdateChunkFilename: isWebpack5\n ? 'static/webpack/[id].[fullhash].hot-update.js'\n : 'static/webpack/[id].[hash].hot-update.js',\n hotUpdateMainFilename: isWebpack5\n ? 'static/webpack/[fullhash].[runtime].hot-update.json'\n : 'static/webpack/[hash].hot-update.json',\n // This saves chunks with the name given via `import()`\n chunkFilename: isServer\n ? '[name].js'\n : `static/chunks/${isDevFallback ? 'fallback/' : ''}${\n dev ? '[name]' : '[name].[contenthash]'\n }.js`,\n strictModuleExceptionHandling: true,\n crossOriginLoading: crossOrigin,\n futureEmitAssets: !dev,\n webassemblyModuleFilename: 'static/wasm/[modulehash].wasm',\n },\n performance: false,\n resolve: resolveConfig,\n resolveLoader: {\n // The loaders Next.js provides\n alias: [\n 'emit-file-loader',\n 'error-loader',\n 'next-babel-loader',\n 'next-client-pages-loader',\n 'next-image-loader',\n 'next-serverless-loader',\n 'noop-loader',\n 'next-style-loader',\n ].reduce((alias, loader) => {\n // using multiple aliases to replace `resolveLoader.modules`\n alias[loader] = path.join(__dirname, 'webpack', 'loaders', loader)\n\n return alias\n }, {} as Record<string, string>),\n modules: [\n 'node_modules',\n ...nodePathList, // Support for NODE_PATH environment variable\n ],\n plugins: isWebpack5 ? [] : [require('pnp-webpack-plugin')],\n },\n module: {\n rules: [\n ...(isWebpack5\n ? [\n // TODO: FIXME: do NOT webpack 5 support with this\n // x-ref: https://github.com/webpack/webpack/issues/11467\n {\n test: /\\.m?js/,\n resolve: {\n fullySpecified: false,\n },\n } as any,\n ]\n : []),\n {\n test: /\\.(tsx|ts|js|mjs|jsx)$/,\n ...(config.experimental.externalDir\n ? // Allowing importing TS/TSX files from outside of the root dir.\n {}\n : { include: [dir, ...babelIncludeRegexes] }),\n exclude: (excludePath: string) => {\n if (babelIncludeRegexes.some((r) => r.test(excludePath))) {\n return false\n }\n return /node_modules/.test(excludePath)\n },\n use: hasReactRefresh\n ? [\n require.resolve('@next/react-refresh-utils/loader'),\n defaultLoaders.babel,\n ]\n : defaultLoaders.babel,\n },\n ].filter(Boolean),\n },\n plugins: [\n hasReactRefresh && new ReactRefreshWebpackPlugin(webpack),\n // Makes sure `Buffer` and `process` are polyfilled in client-side bundles (same behavior as webpack 4)\n isWebpack5 &&\n !isServer &&\n new webpack.ProvidePlugin({\n Buffer: [require.resolve('buffer'), 'Buffer'],\n process: [require.resolve('process')],\n }),\n // This plugin makes sure `output.filename` is used for entry chunks\n !isWebpack5 && new ChunkNamesPlugin(),\n new webpack.DefinePlugin({\n ...Object.keys(process.env).reduce(\n (prev: { [key: string]: string }, key: string) => {\n if (key.startsWith('NEXT_PUBLIC_')) {\n prev[`process.env.${key}`] = JSON.stringify(process.env[key]!)\n }\n return prev\n },\n {}\n ),\n ...Object.keys(config.env).reduce((acc, key) => {\n if (/^(?:NODE_.+)|^(?:__.+)$/i.test(key)) {\n throw new Error(\n `The key \"${key}\" under \"env\" in next.config.js is not allowed. https://nextjs.org/docs/messages/env-key-not-allowed`\n )\n }\n\n return {\n ...acc,\n [`process.env.${key}`]: JSON.stringify(config.env[key]),\n }\n }, {}),\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV': JSON.stringify(\n dev ? 'development' : 'production'\n ),\n 'process.env.__NEXT_CROSS_ORIGIN': JSON.stringify(crossOrigin),\n 'process.browser': JSON.stringify(!isServer),\n 'process.env.__NEXT_TEST_MODE': JSON.stringify(\n process.env.__NEXT_TEST_MODE\n ),\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && !isServer\n ? {\n 'process.env.__NEXT_DIST_DIR': JSON.stringify(distDir),\n }\n : {}),\n 'process.env.__NEXT_TRAILING_SLASH': JSON.stringify(\n config.trailingSlash\n ),\n 'process.env.__NEXT_BUILD_INDICATOR': JSON.stringify(\n config.devIndicators.buildActivity\n ),\n 'process.env.__NEXT_PLUGINS': JSON.stringify(\n config.experimental.plugins\n ),\n 'process.env.__NEXT_STRICT_MODE': JSON.stringify(\n config.reactStrictMode\n ),\n 'process.env.__NEXT_REACT_ROOT': JSON.stringify(hasReactRoot),\n 'process.env.__NEXT_OPTIMIZE_FONTS': JSON.stringify(\n config.optimizeFonts && !dev\n ),\n 'process.env.__NEXT_OPTIMIZE_IMAGES': JSON.stringify(\n config.experimental.optimizeImages\n ),\n 'process.env.__NEXT_OPTIMIZE_CSS': JSON.stringify(\n config.experimental.optimizeCss && !dev\n ),\n 'process.env.__NEXT_SCROLL_RESTORATION': JSON.stringify(\n config.experimental.scrollRestoration\n ),\n 'process.env.__NEXT_IMAGE_OPTS': JSON.stringify({\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n path: config.images.path,\n loader: config.images.loader,\n ...(dev\n ? {\n // pass domains in development to allow validating on the client\n domains: config.images.domains,\n }\n : {}),\n }),\n 'process.env.__NEXT_ROUTER_BASEPATH': JSON.stringify(config.basePath),\n 'process.env.__NEXT_HAS_REWRITES': JSON.stringify(hasRewrites),\n 'process.env.__NEXT_I18N_SUPPORT': JSON.stringify(!!config.i18n),\n 'process.env.__NEXT_I18N_DOMAINS': JSON.stringify(config.i18n?.domains),\n 'process.env.__NEXT_ANALYTICS_ID': JSON.stringify(config.analyticsId),\n ...(isServer\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': JSON.stringify(false),\n }\n : undefined),\n // stub process.env with proxy to warn a missing value is\n // being accessed in development mode\n ...(config.experimental.pageEnv && dev\n ? {\n 'process.env': `\n new Proxy(${isServer ? 'process.env' : '{}'}, {\n get(target, prop) {\n if (typeof target[prop] === 'undefined') {\n console.warn(\\`An environment variable (\\${prop}) that was not provided in the environment was accessed.\\nSee more info here: https://nextjs.org/docs/messages/missing-env-value\\`)\n }\n return target[prop]\n }\n })\n `,\n }\n : {}),\n }),\n !isServer &&\n new ReactLoadablePlugin({\n filename: REACT_LOADABLE_MANIFEST,\n pagesDir,\n }),\n !isServer && new DropClientPage(),\n // Moment.js is an extremely popular library that bundles large locale files\n // by default due to how Webpack interprets its code. This is a practical\n // solution that requires the user to opt into importing specific locales.\n // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack\n config.excludeDefaultMomentLocales &&\n new webpack.IgnorePlugin({\n resourceRegExp: /^\\.\\/locale$/,\n contextRegExp: /moment$/,\n }),\n ...(dev\n ? (() => {\n // Even though require.cache is server only we have to clear assets from both compilations\n // This is because the client compilation generates the build manifest that's used on the server side\n const {\n NextJsRequireCacheHotReloader,\n } = require('./webpack/plugins/nextjs-require-cache-hot-reloader')\n const devPlugins = [new NextJsRequireCacheHotReloader()]\n\n if (!isServer) {\n devPlugins.push(new webpack.HotModuleReplacementPlugin())\n }\n\n return devPlugins\n })()\n : []),\n // Webpack 5 no longer requires this plugin in production:\n !isWebpack5 && !dev && new webpack.HashedModuleIdsPlugin(),\n !dev &&\n new webpack.IgnorePlugin({\n resourceRegExp: /react-is/,\n contextRegExp: /(next-server|next)[\\\\/]dist[\\\\/]/,\n }),\n isServerless && isServer && new ServerlessPlugin(),\n isServer &&\n new PagesManifestPlugin({ serverless: isLikeServerless, dev }),\n !isWebpack5 &&\n target === 'server' &&\n isServer &&\n new NextJsSSRModuleCachePlugin({ outputPath }),\n isServer && new NextJsSsrImportPlugin(),\n !isServer &&\n new BuildManifestPlugin({\n buildId,\n rewrites,\n isDevFallback,\n }),\n !dev &&\n !isServer &&\n config.experimental.stats &&\n new BuildStatsPlugin({\n distDir,\n }),\n new ProfilingPlugin(),\n config.optimizeFonts &&\n !dev &&\n isServer &&\n (function () {\n const {\n FontStylesheetGatheringPlugin,\n } = require('./webpack/plugins/font-stylesheet-gathering-plugin') as {\n FontStylesheetGatheringPlugin: typeof import('./webpack/plugins/font-stylesheet-gathering-plugin').FontStylesheetGatheringPlugin\n }\n return new FontStylesheetGatheringPlugin({\n isLikeServerless,\n })\n })(),\n config.experimental.conformance &&\n !isWebpack5 &&\n !dev &&\n new WebpackConformancePlugin({\n tests: [\n !isServer &&\n conformanceConfig.MinificationConformanceCheck.enabled &&\n new MinificationConformanceCheck(),\n conformanceConfig.ReactSyncScriptsConformanceCheck.enabled &&\n new ReactSyncScriptsConformanceCheck({\n AllowedSources:\n conformanceConfig.ReactSyncScriptsConformanceCheck\n .allowedSources || [],\n }),\n !isServer &&\n conformanceConfig.DuplicatePolyfillsConformanceCheck.enabled &&\n new DuplicatePolyfillsConformanceCheck({\n BlockedAPIToBePolyfilled:\n conformanceConfig.DuplicatePolyfillsConformanceCheck\n .BlockedAPIToBePolyfilled,\n }),\n !isServer &&\n conformanceConfig.GranularChunksConformanceCheck.enabled &&\n new GranularChunksConformanceCheck(\n splitChunksConfigs.prodGranular\n ),\n ].filter(Boolean),\n }),\n new WellKnownErrorsPlugin(),\n ].filter((Boolean as any) as ExcludesFalse),\n }\n\n // Support tsconfig and jsconfig baseUrl\n if (resolvedBaseUrl) {\n webpackConfig.resolve?.modules?.push(resolvedBaseUrl)\n }\n\n if (jsConfig?.compilerOptions?.paths && resolvedBaseUrl) {\n webpackConfig.resolve?.plugins?.unshift(\n new JsConfigPathsPlugin(jsConfig.compilerOptions.paths, resolvedBaseUrl)\n )\n }\n\n if (isWebpack5) {\n // futureEmitAssets is on by default in webpack 5\n delete webpackConfig.output?.futureEmitAssets\n\n if (isServer && dev) {\n // Enable building of client compilation before server compilation in development\n // @ts-ignore dependencies exists\n webpackConfig.dependencies = ['client']\n }\n // webpack 5 no longer polyfills Node.js modules:\n if (webpackConfig.node) delete webpackConfig.node.setImmediate\n\n // Due to bundling of webpack the default values can't be correctly detected\n // This restores the webpack defaults\n // @ts-ignore webpack 5\n webpackConfig.snapshot = {}\n if (process.versions.pnp === '3') {\n const match = /^(.+?)[\\\\/]cache[\\\\/]jest-worker-npm-[^\\\\/]+\\.zip[\\\\/]node_modules[\\\\/]/.exec(\n require.resolve('jest-worker')\n )\n if (match) {\n // @ts-ignore webpack 5\n webpackConfig.snapshot.managedPaths = [\n path.resolve(match[1], 'unplugged'),\n ]\n }\n } else {\n const match = /^(.+?[\\\\/]node_modules)[\\\\/]/.exec(\n require.resolve('jest-worker')\n )\n if (match) {\n // @ts-ignore webpack 5\n webpackConfig.snapshot.managedPaths = [match[1]]\n }\n }\n if (process.versions.pnp === '1') {\n const match = /^(.+?[\\\\/]v4)[\\\\/]npm-jest-worker-[^\\\\/]+-[\\da-f]{40}[\\\\/]node_modules[\\\\/]/.exec(\n require.resolve('jest-worker')\n )\n if (match) {\n // @ts-ignore webpack 5\n webpackConfig.snapshot.immutablePaths = [match[1]]\n }\n } else if (process.versions.pnp === '3') {\n const match = /^(.+?)[\\\\/]jest-worker-npm-[^\\\\/]+\\.zip[\\\\/]node_modules[\\\\/]/.exec(\n require.resolve('jest-worker')\n )\n if (match) {\n // @ts-ignore webpack 5\n webpackConfig.snapshot.immutablePaths = [match[1]]\n }\n }\n\n if (dev) {\n if (!webpackConfig.optimization) {\n webpackConfig.optimization = {}\n }\n webpackConfig.optimization.providedExports = false\n webpackConfig.optimization.usedExports = false\n }\n\n const configVars = JSON.stringify({\n crossOrigin: config.crossOrigin,\n pageExtensions: config.pageExtensions,\n trailingSlash: config.trailingSlash,\n buildActivity: config.devIndicators.buildActivity,\n plugins: config.experimental.plugins,\n reactStrictMode: config.reactStrictMode,\n reactMode: config.experimental.reactMode,\n optimizeFonts: config.optimizeFonts,\n optimizeImages: config.experimental.optimizeImages,\n optimizeCss: config.experimental.optimizeCss,\n scrollRestoration: config.experimental.scrollRestoration,\n basePath: config.basePath,\n pageEnv: config.experimental.pageEnv,\n excludeDefaultMomentLocales: config.excludeDefaultMomentLocales,\n assetPrefix: config.assetPrefix,\n disableOptimizedLoading: config.experimental.disableOptimizedLoading,\n target,\n reactProductionProfiling,\n webpack: !!config.webpack,\n hasRewrites,\n })\n\n const cache: any = {\n type: 'filesystem',\n // Includes:\n // - Next.js version\n // - next.config.js keys that affect compilation\n version: `${process.env.__NEXT_VERSION}|${configVars}`,\n cacheDirectory: path.join(distDir, 'cache', 'webpack'),\n }\n\n // Adds `next.config.js` as a buildDependency when custom webpack config is provided\n if (config.webpack && config.configFile) {\n cache.buildDependencies = {\n config: [config.configFile],\n }\n }\n\n webpackConfig.cache = cache\n\n if (process.env.NEXT_WEBPACK_LOGGING) {\n const logInfra = process.env.NEXT_WEBPACK_LOGGING.includes(\n 'infrastructure'\n )\n const logProfileClient = process.env.NEXT_WEBPACK_LOGGING.includes(\n 'profile-client'\n )\n const logProfileServer = process.env.NEXT_WEBPACK_LOGGING.includes(\n 'profile-server'\n )\n const logDefault = !logInfra && !logProfileClient && !logProfileServer\n\n if (logDefault || logInfra) {\n // @ts-ignore TODO: remove ignore when webpack 5 is stable\n webpackConfig.infrastructureLogging = {\n level: 'verbose',\n debug: /FileSystemInfo/,\n }\n }\n\n if (\n logDefault ||\n (logProfileClient && !isServer) ||\n (logProfileServer && isServer)\n ) {\n webpackConfig.plugins!.push((compiler: webpack.Compiler) => {\n compiler.hooks.done.tap('next-webpack-logging', (stats) => {\n console.log(\n stats.toString({\n colors: true,\n // @ts-ignore TODO: remove ignore when webpack 5 is stable\n logging: logDefault ? 'log' : 'verbose',\n })\n )\n })\n })\n }\n\n if ((logProfileClient && !isServer) || (logProfileServer && isServer)) {\n webpackConfig.plugins!.push(\n new webpack.ProgressPlugin({\n // @ts-ignore TODO: remove ignore when webpack 5 is stable\n profile: true,\n })\n )\n webpackConfig.profile = true\n }\n }\n }\n\n webpackConfig = await buildConfiguration(webpackConfig, {\n rootDirectory: dir,\n customAppFile,\n isDevelopment: dev,\n isServer,\n assetPrefix: config.assetPrefix || '',\n sassOptions: config.sassOptions,\n productionBrowserSourceMaps: config.productionBrowserSourceMaps,\n future: config.future,\n isCraCompat: config.experimental.craCompat,\n })\n\n let originalDevtool = webpackConfig.devtool\n if (typeof config.webpack === 'function') {\n webpackConfig = config.webpack(webpackConfig, {\n dir,\n dev,\n isServer,\n buildId,\n config,\n defaultLoaders,\n totalPages,\n webpack,\n })\n\n if (!webpackConfig) {\n throw new Error(\n 'Webpack config is undefined. You may have forgot to return properly from within the \"webpack\" method of your next.config.js.\\n' +\n 'See more info here https://nextjs.org/docs/messages/undefined-webpack-config'\n )\n }\n\n if (dev && originalDevtool !== webpackConfig.devtool) {\n webpackConfig.devtool = originalDevtool\n devtoolRevertWarning(originalDevtool)\n }\n\n if (typeof (webpackConfig as any).then === 'function') {\n console.warn(\n '> Promise returned in next config. https://nextjs.org/docs/messages/promise-in-next-config'\n )\n }\n }\n\n if (!config.images.disableStaticImages && isWebpack5) {\n if (!webpackConfig.module) {\n webpackConfig.module = { rules: [] }\n }\n\n const hasSvg = webpackConfig.module.rules.some(\n (rule) =>\n 'test' in rule && rule.test instanceof RegExp && rule.test.test('.svg')\n )\n\n // Exclude svg if the user already defined it in custom\n // webpack config such as `@svgr/webpack` plugin or\n // the `babel-plugin-inline-react-svg` plugin.\n webpackConfig.module.rules.push({\n test: hasSvg\n ? /\\.(png|jpg|jpeg|gif|webp|ico|bmp)$/i\n : /\\.(png|svg|jpg|jpeg|gif|webp|ico|bmp)$/i,\n loader: 'next-image-loader',\n dependency: { not: ['url'] },\n // @ts-ignore\n issuer: { not: regexLikeCss },\n })\n }\n\n if (\n config.experimental.craCompat &&\n webpackConfig.module?.rules &&\n webpackConfig.plugins\n ) {\n // CRA prevents loading all locales by default\n // https://github.com/facebook/create-react-app/blob/fddce8a9e21bf68f37054586deb0c8636a45f50b/packages/react-scripts/config/webpack.config.js#L721\n webpackConfig.plugins.push(\n new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/)\n )\n\n // CRA allows importing non-webpack handled files with file-loader\n // these need to be the last rule to prevent catching other items\n // https://github.com/facebook/create-react-app/blob/fddce8a9e21bf68f37054586deb0c8636a45f50b/packages/react-scripts/config/webpack.config.js#L594\n const fileLoaderExclude = [/\\.(js|mjs|jsx|ts|tsx|json)$/]\n const fileLoader = isWebpack5\n ? {\n exclude: fileLoaderExclude,\n issuer: fileLoaderExclude,\n type: 'asset/resource',\n generator: {\n publicPath: '/_next/',\n filename: 'static/media/[name].[hash:8].[ext]',\n },\n }\n : {\n loader: require.resolve('next/dist/compiled/file-loader'),\n // Exclude `js` files to keep \"css\" loader working as it injects\n // its runtime that would otherwise be processed through \"file\" loader.\n // Also exclude `html` and `json` extensions so they get processed\n // by webpacks internal loaders.\n exclude: fileLoaderExclude,\n issuer: fileLoaderExclude,\n options: {\n publicPath: '/_next/static/media',\n outputPath: 'static/media',\n name: '[name].[hash:8].[ext]',\n },\n }\n\n const topRules = []\n const innerRules = []\n\n for (const rule of webpackConfig.module.rules) {\n if (rule.resolve) {\n topRules.push(rule)\n } else {\n if (\n rule.oneOf &&\n !(rule.test || rule.exclude || rule.resource || rule.issuer)\n ) {\n rule.oneOf.forEach((r) => innerRules.push(r))\n } else {\n innerRules.push(rule)\n }\n }\n }\n\n webpackConfig.module.rules = [\n ...(topRules as any),\n {\n oneOf: [...innerRules, fileLoader],\n },\n ]\n }\n\n // Backwards compat with webpack-dev-middleware options object\n if (typeof config.webpackDevMiddleware === 'function') {\n const options = config.webpackDevMiddleware({\n watchOptions: webpackConfig.watchOptions,\n })\n if (options.watchOptions) {\n webpackConfig.watchOptions = options.watchOptions\n }\n }\n\n function canMatchCss(rule: webpack.RuleSetCondition | undefined): boolean {\n if (!rule) {\n return false\n }\n\n const fileNames = [\n '/tmp/test.css',\n '/tmp/test.scss',\n '/tmp/test.sass',\n '/tmp/test.less',\n '/tmp/test.styl',\n ]\n\n if (rule instanceof RegExp && fileNames.some((input) => rule.test(input))) {\n return true\n }\n\n if (typeof rule === 'function') {\n if (\n fileNames.some((input) => {\n try {\n if (rule(input)) {\n return true\n }\n } catch (_) {}\n return false\n })\n ) {\n return true\n }\n }\n\n if (Array.isArray(rule) && rule.some(canMatchCss)) {\n return true\n }\n\n return false\n }\n\n const hasUserCssConfig =\n webpackConfig.module?.rules.some(\n (rule) => canMatchCss(rule.test) || canMatchCss(rule.include)\n ) ?? false\n\n if (hasUserCssConfig) {\n // only show warning for one build\n if (isServer) {\n console.warn(\n chalk.yellow.bold('Warning: ') +\n chalk.bold(\n 'Built-in CSS support is being disabled due to custom CSS configuration being detected.\\n'\n ) +\n 'See here for more info: https://nextjs.org/docs/messages/built-in-css-disabled\\n'\n )\n }\n\n if (webpackConfig.module?.rules.length) {\n // Remove default CSS Loader\n webpackConfig.module.rules = webpackConfig.module.rules.filter(\n (r) =>\n !(\n typeof r.oneOf?.[0]?.options === 'object' &&\n r.oneOf[0].options.__next_css_remove === true\n )\n )\n }\n if (webpackConfig.plugins?.length) {\n // Disable CSS Extraction Plugin\n webpackConfig.plugins = webpackConfig.plugins.filter(\n (p) => (p as any).__next_css_remove !== true\n )\n }\n if (webpackConfig.optimization?.minimizer?.length) {\n // Disable CSS Minifier\n webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.filter(\n (e) => (e as any).__next_css_remove !== true\n )\n }\n } else if (!config.future.strictPostcssConfiguration) {\n await __overrideCssConfiguration(dir, !dev, webpackConfig)\n }\n\n // Inject missing React Refresh loaders so that development mode is fast:\n if (hasReactRefresh) {\n attachReactRefresh(webpackConfig, defaultLoaders.babel)\n }\n\n // check if using @zeit/next-typescript and show warning\n if (\n isServer &&\n webpackConfig.module &&\n Array.isArray(webpackConfig.module.rules)\n ) {\n let foundTsRule = false\n\n webpackConfig.module.rules = webpackConfig.module.rules.filter(\n (rule): boolean => {\n if (!(rule.test instanceof RegExp)) return true\n if ('noop.ts'.match(rule.test) && !'noop.js'.match(rule.test)) {\n // remove if it matches @zeit/next-typescript\n foundTsRule = rule.use === defaultLoaders.babel\n return !foundTsRule\n }\n return true\n }\n )\n\n if (foundTsRule) {\n console.warn(\n '\\n@zeit/next-typescript is no longer needed since Next.js has built-in support for TypeScript now. Please remove it from your next.config.js and your .babelrc\\n'\n )\n }\n }\n\n // Patch `@zeit/next-sass`, `@zeit/next-less`, `@zeit/next-stylus` for compatibility\n if (webpackConfig.module && Array.isArray(webpackConfig.module.rules)) {\n ;[].forEach.call(webpackConfig.module.rules, function (\n rule: webpack.RuleSetRule\n ) {\n if (!(rule.test instanceof RegExp && Array.isArray(rule.use))) {\n return\n }\n\n const isSass =\n rule.test.source === '\\\\.scss$' || rule.test.source === '\\\\.sass$'\n const isLess = rule.test.source === '\\\\.less$'\n const isCss = rule.test.source === '\\\\.css$'\n const isStylus = rule.test.source === '\\\\.styl$'\n\n // Check if the rule we're iterating over applies to Sass, Less, or CSS\n if (!(isSass || isLess || isCss || isStylus)) {\n return\n }\n\n ;[].forEach.call(rule.use, function (use: webpack.RuleSetUseItem) {\n if (\n !(\n use &&\n typeof use === 'object' &&\n // Identify use statements only pertaining to `css-loader`\n (use.loader === 'css-loader' ||\n use.loader === 'css-loader/locals') &&\n use.options &&\n typeof use.options === 'object' &&\n // The `minimize` property is a good heuristic that we need to\n // perform this hack. The `minimize` property was only valid on\n // old `css-loader` versions. Custom setups (that aren't next-sass,\n // next-less or next-stylus) likely have the newer version.\n // We still handle this gracefully below.\n (Object.prototype.hasOwnProperty.call(use.options, 'minimize') ||\n Object.prototype.hasOwnProperty.call(\n use.options,\n 'exportOnlyLocals'\n ))\n )\n ) {\n return\n }\n\n // Try to monkey patch within a try-catch. We shouldn't fail the build\n // if we cannot pull this off.\n // The user may not even be using the `next-sass` or `next-less` or\n // `next-stylus` plugins.\n // If it does work, great!\n try {\n // Resolve the version of `@zeit/next-css` as depended on by the Sass,\n // Less or Stylus plugin.\n const correctNextCss = require.resolve('@zeit/next-css', {\n paths: [\n isCss\n ? // Resolve `@zeit/next-css` from the base directory\n dir\n : // Else, resolve it from the specific plugins\n require.resolve(\n isSass\n ? '@zeit/next-sass'\n : isLess\n ? '@zeit/next-less'\n : isStylus\n ? '@zeit/next-stylus'\n : 'next'\n ),\n ],\n })\n\n // If we found `@zeit/next-css` ...\n if (correctNextCss) {\n // ... resolve the version of `css-loader` shipped with that\n // package instead of whichever was hoisted highest in your\n // `node_modules` tree.\n const correctCssLoader = require.resolve(use.loader, {\n paths: [correctNextCss],\n })\n if (correctCssLoader) {\n // We saved the user from a failed build!\n use.loader = correctCssLoader\n }\n }\n } catch (_) {\n // The error is not required to be handled.\n }\n })\n })\n }\n\n // Backwards compat for `main.js` entry key\n // and setup of dependencies between entries\n // we can't do that in the initial entry for\n // backward-compat reasons\n const originalEntry: any = webpackConfig.entry\n if (typeof originalEntry !== 'undefined') {\n const updatedEntry = async () => {\n const entry: WebpackEntrypoints =\n typeof originalEntry === 'function'\n ? await originalEntry()\n : originalEntry\n // Server compilation doesn't have main.js\n if (\n clientEntries &&\n Array.isArray(entry['main.js']) &&\n entry['main.js'].length > 0\n ) {\n const originalFile = clientEntries[\n CLIENT_STATIC_FILES_RUNTIME_MAIN\n ] as string\n entry[CLIENT_STATIC_FILES_RUNTIME_MAIN] = [\n ...entry['main.js'],\n originalFile,\n ]\n }\n delete entry['main.js']\n\n if (isWebpack5 && !isServer) {\n for (const name of Object.keys(entry)) {\n if (\n name === 'polyfills' ||\n name === 'main' ||\n name === 'amp' ||\n name === 'react-refresh'\n )\n continue\n const dependOn =\n name.startsWith('pages/') && name !== 'pages/_app'\n ? 'pages/_app'\n : 'main'\n const old = entry[name]\n if (typeof old === 'object' && !Array.isArray(old)) {\n entry[name] = {\n dependOn,\n ...old,\n }\n } else {\n entry[name] = {\n import: old,\n dependOn,\n }\n }\n }\n }\n\n return entry\n }\n // @ts-ignore webpack 5 typings needed\n webpackConfig.entry = updatedEntry\n }\n\n if (!dev) {\n // entry is always a function\n webpackConfig.entry = await (webpackConfig.entry as webpack.EntryFunc)()\n }\n\n return webpackConfig\n}\n"]}
\No newline at end of file