config-shared.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.normalizeConfig = normalizeConfig;
  6. exports.isServerRuntime = isServerRuntime;
  7. exports.validateConfig = validateConfig;
  8. exports.defaultConfig = void 0;
  9. var _os = _interopRequireDefault(require("os"));
  10. var _imageConfig = require("../shared/lib/image-config");
  11. function _interopRequireDefault(obj) {
  12. return obj && obj.__esModule ? obj : {
  13. default: obj
  14. };
  15. }
  16. const defaultConfig = {
  17. env: {},
  18. webpack: null,
  19. webpackDevMiddleware: null,
  20. eslint: {
  21. ignoreDuringBuilds: false
  22. },
  23. typescript: {
  24. ignoreBuildErrors: false,
  25. tsconfigPath: "tsconfig.json"
  26. },
  27. distDir: ".next",
  28. cleanDistDir: true,
  29. assetPrefix: "",
  30. configOrigin: "default",
  31. useFileSystemPublicRoutes: true,
  32. generateBuildId: ()=>null,
  33. generateEtags: true,
  34. pageExtensions: [
  35. "tsx",
  36. "ts",
  37. "jsx",
  38. "js"
  39. ],
  40. target: "server",
  41. poweredByHeader: true,
  42. compress: true,
  43. analyticsId: process.env.VERCEL_ANALYTICS_ID || "",
  44. images: _imageConfig.imageConfigDefault,
  45. devIndicators: {
  46. buildActivity: true,
  47. buildActivityPosition: "bottom-right"
  48. },
  49. onDemandEntries: {
  50. maxInactiveAge: 15 * 1000,
  51. pagesBufferLength: 2
  52. },
  53. amp: {
  54. canonicalBase: ""
  55. },
  56. basePath: "",
  57. sassOptions: {},
  58. trailingSlash: false,
  59. i18n: null,
  60. productionBrowserSourceMaps: false,
  61. optimizeFonts: true,
  62. webpack5: undefined,
  63. excludeDefaultMomentLocales: true,
  64. serverRuntimeConfig: {},
  65. publicRuntimeConfig: {},
  66. reactStrictMode: false,
  67. httpAgentOptions: {
  68. keepAlive: true
  69. },
  70. outputFileTracing: true,
  71. staticPageGenerationTimeout: 60,
  72. swcMinify: false,
  73. output: !!process.env.NEXT_PRIVATE_STANDALONE ? "standalone" : undefined,
  74. experimental: {
  75. optimisticClientCache: true,
  76. runtime: undefined,
  77. manualClientBasePath: false,
  78. // TODO: change default in next major release (current v12.1.5)
  79. legacyBrowsers: true,
  80. browsersListForSwc: false,
  81. // TODO: change default in next major release (current v12.1.5)
  82. newNextLinkBehavior: false,
  83. cpus: Math.max(1, (Number(process.env.CIRCLE_NODE_TOTAL) || (_os.default.cpus() || {
  84. length: 1
  85. }).length) - 1),
  86. sharedPool: true,
  87. profiling: false,
  88. isrFlushToDisk: true,
  89. workerThreads: false,
  90. pageEnv: false,
  91. proxyTimeout: undefined,
  92. optimizeCss: false,
  93. nextScriptWorkers: false,
  94. scrollRestoration: false,
  95. externalDir: false,
  96. disableOptimizedLoading: false,
  97. gzipSize: true,
  98. swcFileReading: true,
  99. craCompat: false,
  100. esmExternals: true,
  101. appDir: false,
  102. // default to 50MB limit
  103. isrMemoryCacheSize: 50 * 1024 * 1024,
  104. incrementalCacheHandlerPath: undefined,
  105. serverComponents: false,
  106. fullySpecified: false,
  107. outputFileTracingRoot: process.env.NEXT_PRIVATE_OUTPUT_TRACE_ROOT || "",
  108. swcTraceProfiling: false,
  109. forceSwcTransforms: false,
  110. swcPlugins: undefined,
  111. swcMinifyDebugOptions: undefined,
  112. largePageDataBytes: 128 * 1000,
  113. disablePostcssPresetEnv: undefined,
  114. amp: undefined,
  115. urlImports: undefined,
  116. modularizeImports: undefined,
  117. adjustFontFallbacks: false
  118. }
  119. };
  120. exports.defaultConfig = defaultConfig;
  121. async function normalizeConfig(phase, config) {
  122. if (typeof config === "function") {
  123. config = config(phase, {
  124. defaultConfig
  125. });
  126. }
  127. // Support `new Promise` and `async () =>` as return values of the config export
  128. return await config;
  129. }
  130. function isServerRuntime(value) {
  131. return value === undefined || value === "nodejs" || value === "experimental-edge";
  132. }
  133. function validateConfig(userConfig) {
  134. const configValidator = require("next/dist/next-config-validate.js");
  135. configValidator(userConfig);
  136. return {
  137. errors: configValidator.errors
  138. };
  139. }
  140. //# sourceMappingURL=config-shared.js.map