config-schema.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. "use strict";
  2. var _imageConfig = require("../shared/lib/image-config");
  3. const configSchema = {
  4. type: "object",
  5. additionalProperties: false,
  6. properties: {
  7. amp: {
  8. additionalProperties: false,
  9. properties: {
  10. canonicalBase: {
  11. minLength: 1,
  12. type: "string"
  13. }
  14. },
  15. type: "object"
  16. },
  17. analyticsId: {
  18. type: "string"
  19. },
  20. assetPrefix: {
  21. minLength: 1,
  22. type: "string"
  23. },
  24. basePath: {
  25. type: "string"
  26. },
  27. cleanDistDir: {
  28. type: "boolean"
  29. },
  30. compiler: {
  31. additionalProperties: false,
  32. properties: {
  33. emotion: {
  34. oneOf: [
  35. {
  36. type: "boolean"
  37. },
  38. {
  39. type: "object",
  40. additionalProperties: false,
  41. properties: {
  42. sourceMap: {
  43. type: "boolean"
  44. },
  45. autoLabel: {
  46. type: "string",
  47. enum: [
  48. "always",
  49. "dev-only",
  50. "never"
  51. ]
  52. },
  53. labelFormat: {
  54. type: "string",
  55. minLength: 1
  56. }
  57. }
  58. },
  59. ]
  60. },
  61. reactRemoveProperties: {
  62. oneOf: [
  63. {
  64. type: "boolean"
  65. },
  66. {
  67. type: "object",
  68. additionalProperties: false,
  69. properties: {
  70. properties: {
  71. type: "array",
  72. items: {
  73. type: "string"
  74. }
  75. }
  76. }
  77. },
  78. ]
  79. },
  80. relay: {
  81. type: "object"
  82. },
  83. removeConsole: {
  84. oneOf: [
  85. {
  86. type: "boolean"
  87. },
  88. {
  89. type: "object",
  90. additionalProperties: false,
  91. properties: {
  92. exclude: {
  93. type: "array",
  94. items: {
  95. type: "string",
  96. minLength: 1
  97. }
  98. }
  99. }
  100. },
  101. ]
  102. },
  103. styledComponents: {
  104. oneOf: [
  105. {
  106. type: "boolean"
  107. },
  108. {
  109. type: "object",
  110. additionalProperties: false,
  111. properties: {
  112. displayName: {
  113. type: "boolean"
  114. },
  115. topLevelImportPaths: {
  116. oneOf: [
  117. {
  118. type: "boolean"
  119. },
  120. {
  121. type: "array",
  122. items: {
  123. type: "string",
  124. minLength: 1
  125. }
  126. },
  127. ]
  128. },
  129. ssr: {
  130. type: "boolean"
  131. },
  132. fileName: {
  133. type: "boolean"
  134. },
  135. meaninglessFileNames: {
  136. oneOf: [
  137. {
  138. type: "boolean"
  139. },
  140. {
  141. type: "array",
  142. items: {
  143. type: "string",
  144. minLength: 1
  145. }
  146. },
  147. ]
  148. },
  149. minify: {
  150. type: "boolean"
  151. },
  152. transpileTemplateLiterals: {
  153. type: "boolean"
  154. },
  155. namespace: {
  156. type: "string",
  157. minLength: 1
  158. },
  159. pure: {
  160. type: "boolean"
  161. },
  162. cssProp: {
  163. type: "boolean"
  164. }
  165. }
  166. },
  167. ]
  168. }
  169. },
  170. type: "object"
  171. },
  172. compress: {
  173. type: "boolean"
  174. },
  175. crossOrigin: {
  176. oneOf: [
  177. false,
  178. {
  179. enum: [
  180. "anonymous",
  181. "use-credentials"
  182. ],
  183. type: "string"
  184. },
  185. ]
  186. },
  187. devIndicators: {
  188. additionalProperties: false,
  189. properties: {
  190. buildActivity: {
  191. type: "boolean"
  192. },
  193. buildActivityPosition: {
  194. // automatic typing does not like enum
  195. enum: [
  196. "bottom-left",
  197. "bottom-right",
  198. "top-left",
  199. "top-right"
  200. ],
  201. type: "string"
  202. }
  203. },
  204. type: "object"
  205. },
  206. distDir: {
  207. minLength: 1,
  208. type: "string",
  209. nullable: true
  210. },
  211. env: {
  212. type: "object"
  213. },
  214. eslint: {
  215. additionalProperties: false,
  216. properties: {
  217. dirs: {
  218. items: {
  219. minLength: 1,
  220. type: "string"
  221. },
  222. type: "array"
  223. },
  224. ignoreDuringBuilds: {
  225. type: "boolean"
  226. }
  227. },
  228. type: "object"
  229. },
  230. excludeDefaultMomentLocales: {
  231. type: "boolean"
  232. },
  233. experimental: {
  234. additionalProperties: false,
  235. properties: {
  236. adjustFontFallbacks: {
  237. type: "boolean"
  238. },
  239. allowMiddlewareResponseBody: {
  240. type: "boolean"
  241. },
  242. amp: {
  243. additionalProperties: false,
  244. properties: {
  245. optimizer: {
  246. type: "object"
  247. },
  248. skipValidation: {
  249. type: "boolean"
  250. },
  251. validator: {
  252. type: "string"
  253. }
  254. },
  255. type: "object"
  256. },
  257. appDir: {
  258. type: "boolean"
  259. },
  260. browsersListForSwc: {
  261. type: "boolean"
  262. },
  263. cpus: {
  264. type: "number"
  265. },
  266. craCompat: {
  267. type: "boolean"
  268. },
  269. disableOptimizedLoading: {
  270. type: "boolean"
  271. },
  272. disablePostcssPresetEnv: {
  273. type: "boolean"
  274. },
  275. esmExternals: {
  276. oneOf: [
  277. {
  278. type: "boolean"
  279. },
  280. {
  281. const: "loose"
  282. },
  283. ]
  284. },
  285. externalDir: {
  286. type: "boolean"
  287. },
  288. fallbackNodePolyfills: {
  289. type: "boolean"
  290. },
  291. forceSwcTransforms: {
  292. type: "boolean"
  293. },
  294. fullySpecified: {
  295. type: "boolean"
  296. },
  297. gzipSize: {
  298. type: "boolean"
  299. },
  300. incrementalCacheHandlerPath: {
  301. type: "string"
  302. },
  303. isrFlushToDisk: {
  304. type: "boolean"
  305. },
  306. isrMemoryCacheSize: {
  307. type: "number"
  308. },
  309. largePageDataBytes: {
  310. type: "number"
  311. },
  312. legacyBrowsers: {
  313. type: "boolean"
  314. },
  315. manualClientBasePath: {
  316. type: "boolean"
  317. },
  318. modularizeImports: {
  319. type: "object"
  320. },
  321. newNextLinkBehavior: {
  322. type: "boolean"
  323. },
  324. nextScriptWorkers: {
  325. type: "boolean"
  326. },
  327. optimizeCss: {
  328. oneOf: [
  329. {
  330. type: "boolean"
  331. },
  332. {
  333. type: "object"
  334. },
  335. ]
  336. },
  337. optimisticClientCache: {
  338. type: "boolean"
  339. },
  340. outputFileTracingRoot: {
  341. minLength: 1,
  342. type: "string"
  343. },
  344. pageEnv: {
  345. type: "boolean"
  346. },
  347. profiling: {
  348. type: "boolean"
  349. },
  350. proxyTimeout: {
  351. minimum: 0,
  352. type: "number"
  353. },
  354. runtime: {
  355. // automatic typing doesn't like enum
  356. enum: [
  357. "experimental-edge",
  358. "nodejs"
  359. ],
  360. type: "string"
  361. },
  362. scrollRestoration: {
  363. type: "boolean"
  364. },
  365. serverComponents: {
  366. type: "boolean"
  367. },
  368. sharedPool: {
  369. type: "boolean"
  370. },
  371. skipMiddlewareUrlNormalize: {
  372. type: "boolean"
  373. },
  374. skipTrailingSlashRedirect: {
  375. type: "boolean"
  376. },
  377. sri: {
  378. properties: {
  379. algorithm: {
  380. enum: [
  381. "sha256",
  382. "sha384",
  383. "sha512"
  384. ],
  385. type: "string"
  386. }
  387. },
  388. type: "object"
  389. },
  390. swcFileReading: {
  391. type: "boolean"
  392. },
  393. swcMinify: {
  394. type: "boolean"
  395. },
  396. swcMinifyDebugOptions: {
  397. additionalProperties: false,
  398. properties: {
  399. compress: {
  400. type: "object"
  401. },
  402. mangle: {
  403. type: "object"
  404. }
  405. },
  406. type: "object"
  407. },
  408. swcPlugins: {
  409. type: "array"
  410. },
  411. swcTraceProfiling: {
  412. type: "boolean"
  413. },
  414. urlImports: {
  415. items: {
  416. type: "string"
  417. },
  418. type: "array"
  419. },
  420. workerThreads: {
  421. type: "boolean"
  422. }
  423. },
  424. type: "object"
  425. },
  426. exportPathMap: {
  427. isFunction: true,
  428. errorMessage: "must be a function that returns a Promise"
  429. },
  430. future: {
  431. additionalProperties: false,
  432. properties: {},
  433. type: "object"
  434. },
  435. generateBuildId: {
  436. isFunction: true,
  437. errorMessage: "must be a function that returns a Promise"
  438. },
  439. generateEtags: {
  440. type: "boolean"
  441. },
  442. headers: {
  443. isFunction: true,
  444. errorMessage: "must be a function that returns a Promise"
  445. },
  446. httpAgentOptions: {
  447. additionalProperties: false,
  448. properties: {
  449. keepAlive: {
  450. type: "boolean"
  451. }
  452. },
  453. type: "object"
  454. },
  455. i18n: {
  456. additionalProperties: false,
  457. properties: {
  458. defaultLocale: {
  459. minLength: 1,
  460. type: "string"
  461. },
  462. domains: {
  463. items: {
  464. additionalProperties: false,
  465. properties: {
  466. defaultLocale: {
  467. minLength: 1,
  468. type: "string"
  469. },
  470. domain: {
  471. minLength: 1,
  472. type: "string"
  473. },
  474. http: {
  475. type: "boolean"
  476. },
  477. locales: {
  478. items: {
  479. minLength: 1,
  480. type: "string"
  481. },
  482. type: "array"
  483. }
  484. },
  485. type: "object"
  486. },
  487. type: "array"
  488. },
  489. localeDetection: {
  490. type: "boolean"
  491. },
  492. locales: {
  493. items: {
  494. minLength: 1,
  495. type: "string"
  496. },
  497. type: "array"
  498. }
  499. },
  500. type: "object"
  501. },
  502. images: {
  503. additionalProperties: false,
  504. properties: {
  505. remotePatterns: {
  506. items: {
  507. additionalProperties: false,
  508. properties: {
  509. hostname: {
  510. minLength: 1,
  511. type: "string"
  512. },
  513. pathname: {
  514. minLength: 1,
  515. type: "string"
  516. },
  517. port: {
  518. minLength: 1,
  519. type: "string"
  520. },
  521. protocol: {
  522. // automatic typing doesn't like enum
  523. enum: [
  524. "http",
  525. "https"
  526. ],
  527. type: "string"
  528. }
  529. },
  530. type: "object"
  531. },
  532. type: "array"
  533. },
  534. unoptimized: {
  535. type: "boolean"
  536. },
  537. contentSecurityPolicy: {
  538. minLength: 1,
  539. type: "string"
  540. },
  541. dangerouslyAllowSVG: {
  542. type: "boolean"
  543. },
  544. deviceSizes: {
  545. items: {
  546. type: "number"
  547. },
  548. minItems: 1,
  549. type: "array"
  550. },
  551. disableStaticImages: {
  552. type: "boolean"
  553. },
  554. domains: {
  555. items: {
  556. type: "string"
  557. },
  558. type: "array"
  559. },
  560. formats: {
  561. items: {
  562. enum: [
  563. "image/avif",
  564. "image/webp"
  565. ],
  566. type: "string"
  567. },
  568. type: "array"
  569. },
  570. imageSizes: {
  571. items: {
  572. type: "number"
  573. },
  574. minItems: 1,
  575. type: "array"
  576. },
  577. loader: {
  578. // automatic typing does not like enum
  579. enum: _imageConfig.VALID_LOADERS,
  580. type: "string"
  581. },
  582. minimumCacheTTL: {
  583. type: "number"
  584. },
  585. path: {
  586. minLength: 1,
  587. type: "string"
  588. }
  589. },
  590. type: "object"
  591. },
  592. onDemandEntries: {
  593. additionalProperties: false,
  594. properties: {
  595. maxInactiveAge: {
  596. type: "number"
  597. },
  598. pagesBufferLength: {
  599. type: "number"
  600. }
  601. },
  602. type: "object"
  603. },
  604. optimizeFonts: {
  605. type: "boolean"
  606. },
  607. output: {
  608. // automatic typing doesn't like enum
  609. enum: [
  610. "standalone"
  611. ],
  612. type: "string"
  613. },
  614. outputFileTracing: {
  615. type: "boolean"
  616. },
  617. pageExtensions: {
  618. minItems: 1,
  619. type: "array"
  620. },
  621. poweredByHeader: {
  622. type: "boolean"
  623. },
  624. productionBrowserSourceMaps: {
  625. type: "boolean"
  626. },
  627. publicRuntimeConfig: {
  628. type: "object"
  629. },
  630. reactStrictMode: {
  631. type: "boolean"
  632. },
  633. redirects: {
  634. isFunction: true,
  635. errorMessage: "must be a function that returns a Promise"
  636. },
  637. rewrites: {
  638. isFunction: true,
  639. errorMessage: "must be a function that returns a Promise"
  640. },
  641. sassOptions: {
  642. type: "object"
  643. },
  644. serverRuntimeConfig: {
  645. type: "object"
  646. },
  647. staticPageGenerationTimeout: {
  648. type: "number"
  649. },
  650. swcMinify: {
  651. type: "boolean"
  652. },
  653. trailingSlash: {
  654. type: "boolean"
  655. },
  656. typescript: {
  657. additionalProperties: false,
  658. properties: {
  659. ignoreBuildErrors: {
  660. type: "boolean"
  661. },
  662. tsconfigPath: {
  663. minLength: 1,
  664. type: "string"
  665. }
  666. },
  667. type: "object"
  668. },
  669. useFileSystemPublicRoutes: {
  670. type: "boolean"
  671. },
  672. webpack: {
  673. isFunction: true,
  674. errorMessage: "must be a function that returns a webpack configuration object"
  675. }
  676. }
  677. };
  678. // module.exports is used to get around an export bug with TypeScript
  679. // and the Ajv automatic typing
  680. module.exports = {
  681. configSchema
  682. };
  683. //# sourceMappingURL=config-schema.js.map