webpackOptionsSchema.json 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545
  1. {
  2. "additionalProperties": false,
  3. "definitions": {
  4. "common.arrayOfStringOrStringArrayValues": {
  5. "items": {
  6. "description": "string or array of strings",
  7. "anyOf": [
  8. {
  9. "minLength": 1,
  10. "type": "string"
  11. },
  12. {
  13. "items": {
  14. "description": "A non-empty string",
  15. "minLength": 1,
  16. "type": "string"
  17. },
  18. "type": "array"
  19. }
  20. ]
  21. },
  22. "type": "array"
  23. },
  24. "common.arrayOfStringValues": {
  25. "items": {
  26. "description": "A non-empty string",
  27. "minLength": 1,
  28. "type": "string"
  29. },
  30. "type": "array"
  31. },
  32. "common.nonEmptyArrayOfUniqueStringValues": {
  33. "items": {
  34. "description": "A non-empty string",
  35. "minLength": 1,
  36. "type": "string"
  37. },
  38. "minItems": 1,
  39. "type": "array",
  40. "uniqueItems": true
  41. },
  42. "entry": {
  43. "oneOf": [
  44. {
  45. "minProperties": 1,
  46. "additionalProperties": {
  47. "description": "An entry point with name",
  48. "oneOf": [
  49. {
  50. "description": "The string is resolved to a module which is loaded upon startup.",
  51. "minLength": 1,
  52. "type": "string"
  53. },
  54. {
  55. "description": "All modules are loaded upon startup. The last one is exported.",
  56. "anyOf": [
  57. {
  58. "$ref": "#/definitions/common.nonEmptyArrayOfUniqueStringValues"
  59. }
  60. ]
  61. }
  62. ]
  63. },
  64. "description": "Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.",
  65. "type": "object"
  66. },
  67. {
  68. "description": "An entry point without name. The string is resolved to a module which is loaded upon startup.",
  69. "minLength": 1,
  70. "type": "string"
  71. },
  72. {
  73. "description": "An entry point without name. All modules are loaded upon startup. The last one is exported.",
  74. "anyOf": [
  75. {
  76. "$ref": "#/definitions/common.nonEmptyArrayOfUniqueStringValues"
  77. }
  78. ]
  79. },
  80. {
  81. "description": "A Function returning an entry object, an entry string, an entry array or a promise to these things.",
  82. "instanceof": "Function"
  83. }
  84. ]
  85. },
  86. "externals": {
  87. "anyOf": [
  88. {
  89. "description": "An exact matched dependency becomes external. The same string is used as external dependency.",
  90. "type": "string"
  91. },
  92. {
  93. "additionalProperties": {
  94. "description": "The dependency used for the external",
  95. "anyOf": [
  96. {
  97. "type": "string"
  98. },
  99. {
  100. "type": "object"
  101. },
  102. {
  103. "type": "boolean"
  104. }
  105. ]
  106. },
  107. "description": "If an dependency matches exactly a property of the object, the property value is used as dependency.",
  108. "type": "object"
  109. },
  110. {
  111. "description": "`function(context, request, callback(err, result))` The function is called on each dependency.",
  112. "instanceof": "Function"
  113. },
  114. {
  115. "description": "Every matched dependency becomes external.",
  116. "instanceof": "RegExp"
  117. },
  118. {
  119. "items": {
  120. "description": "External configuration",
  121. "anyOf": [
  122. {
  123. "$ref": "#/definitions/externals"
  124. }
  125. ]
  126. },
  127. "type": "array"
  128. }
  129. ]
  130. },
  131. "module": {
  132. "additionalProperties": false,
  133. "properties": {
  134. "exprContextCritical": {
  135. "description": "Enable warnings for full dynamic dependencies",
  136. "type": "boolean"
  137. },
  138. "exprContextRecursive": {
  139. "description": "Enable recursive directory lookup for full dynamic dependencies",
  140. "type": "boolean"
  141. },
  142. "exprContextRegExp": {
  143. "description": "Sets the default regular expression for full dynamic dependencies",
  144. "anyOf": [
  145. {
  146. "type": "boolean"
  147. },
  148. {
  149. "instanceof": "RegExp"
  150. }
  151. ]
  152. },
  153. "exprContextRequest": {
  154. "description": "Set the default request for full dynamic dependencies",
  155. "type": "string"
  156. },
  157. "loaders": {
  158. "description": "An array of automatically applied loaders.",
  159. "anyOf": [
  160. {
  161. "$ref": "#/definitions/ruleSet-rules"
  162. }
  163. ]
  164. },
  165. "noParse": {
  166. "description": "Don't parse files matching. It's matched against the full resolved request.",
  167. "anyOf": [
  168. {
  169. "items": {
  170. "description": "A regular expression, when matched the module is not parsed",
  171. "instanceof": "RegExp"
  172. },
  173. "minItems": 1,
  174. "type": "array"
  175. },
  176. {
  177. "instanceof": "RegExp"
  178. },
  179. {
  180. "instanceof": "Function"
  181. },
  182. {
  183. "items": {
  184. "description": "An absolute path, when the module starts with this path it is not parsed",
  185. "type": "string",
  186. "absolutePath": true
  187. },
  188. "minItems": 1,
  189. "type": "array"
  190. },
  191. {
  192. "type": "string",
  193. "absolutePath": true
  194. }
  195. ]
  196. },
  197. "rules": {
  198. "allOf": [
  199. {
  200. "$ref": "#/definitions/ruleSet-rules"
  201. }
  202. ],
  203. "description": "An array of rules applied for modules."
  204. },
  205. "unknownContextCritical": {
  206. "description": "Enable warnings when using the require function in a not statically analyse-able way",
  207. "type": "boolean"
  208. },
  209. "unknownContextRecursive": {
  210. "description": "Enable recursive directory lookup when using the require function in a not statically analyse-able way",
  211. "type": "boolean"
  212. },
  213. "unknownContextRegExp": {
  214. "description": "Sets the regular expression when using the require function in a not statically analyse-able way",
  215. "anyOf": [
  216. {
  217. "type": "boolean"
  218. },
  219. {
  220. "instanceof": "RegExp"
  221. }
  222. ]
  223. },
  224. "unknownContextRequest": {
  225. "description": "Sets the request when using the require function in a not statically analyse-able way",
  226. "type": "string"
  227. },
  228. "unsafeCache": {
  229. "description": "Cache the resolving of module requests",
  230. "anyOf": [
  231. {
  232. "type": "boolean"
  233. },
  234. {
  235. "instanceof": "Function"
  236. }
  237. ]
  238. },
  239. "wrappedContextCritical": {
  240. "description": "Enable warnings for partial dynamic dependencies",
  241. "type": "boolean"
  242. },
  243. "wrappedContextRecursive": {
  244. "description": "Enable recursive directory lookup for partial dynamic dependencies",
  245. "type": "boolean"
  246. },
  247. "wrappedContextRegExp": {
  248. "description": "Set the inner regular expression for partial dynamic dependencies",
  249. "instanceof": "RegExp"
  250. },
  251. "strictExportPresence": {
  252. "description": "Emit errors instead of warnings when imported names don't exist in imported module",
  253. "type": "boolean"
  254. },
  255. "strictThisContextOnImports": {
  256. "description": "Handle the this context correctly according to the spec for namespace objects",
  257. "type": "boolean"
  258. }
  259. },
  260. "type": "object"
  261. },
  262. "output": {
  263. "additionalProperties": false,
  264. "properties": {
  265. "auxiliaryComment": {
  266. "description": "Add a comment in the UMD wrapper.",
  267. "anyOf": [
  268. {
  269. "description": "Append the same comment above each import style.",
  270. "type": "string"
  271. },
  272. {
  273. "additionalProperties": false,
  274. "description": "Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.",
  275. "properties": {
  276. "amd": {
  277. "description": "Set comment for `amd` section in UMD",
  278. "type": "string"
  279. },
  280. "commonjs": {
  281. "description": "Set comment for `commonjs` (exports) section in UMD",
  282. "type": "string"
  283. },
  284. "commonjs2": {
  285. "description": "Set comment for `commonjs2` (module.exports) section in UMD",
  286. "type": "string"
  287. },
  288. "root": {
  289. "description": "Set comment for `root` (global variable) section in UMD",
  290. "type": "string"
  291. }
  292. },
  293. "type": "object"
  294. }
  295. ]
  296. },
  297. "chunkFilename": {
  298. "description": "The filename of non-entry chunks as relative path inside the `output.path` directory.",
  299. "anyOf": [
  300. {
  301. "type": "string"
  302. },
  303. {
  304. "instanceof": "Function"
  305. }
  306. ],
  307. "absolutePath": false
  308. },
  309. "crossOriginLoading": {
  310. "description": "This option enables cross-origin loading of chunks.",
  311. "enum": [
  312. false,
  313. "anonymous",
  314. "use-credentials"
  315. ]
  316. },
  317. "jsonpScriptType": {
  318. "description": "This option enables loading async chunks via a custom script type, such as script type=\"module\"",
  319. "enum": [
  320. "text/javascript",
  321. "module"
  322. ]
  323. },
  324. "chunkLoadTimeout": {
  325. "description": "Number of milliseconds before chunk request expires",
  326. "type": "number"
  327. },
  328. "devtoolFallbackModuleFilenameTemplate": {
  329. "description": "Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.",
  330. "anyOf": [
  331. {
  332. "type": "string"
  333. },
  334. {
  335. "instanceof": "Function"
  336. }
  337. ]
  338. },
  339. "devtoolLineToLine": {
  340. "description": "Enable line to line mapped mode for all/specified modules. Line to line mapped mode uses a simple SourceMap where each line of the generated source is mapped to the same line of the original source. It’s a performance optimization. Only use it if your performance need to be better and you are sure that input lines match which generated lines.",
  341. "anyOf": [
  342. {
  343. "description": "`true` enables it for all modules (not recommended)",
  344. "type": "boolean"
  345. },
  346. {
  347. "description": "An object similar to `module.loaders` enables it for specific files.",
  348. "type": "object"
  349. }
  350. ]
  351. },
  352. "devtoolModuleFilenameTemplate": {
  353. "description": "Filename template string of function for the sources array in a generated SourceMap.",
  354. "anyOf": [
  355. {
  356. "type": "string"
  357. },
  358. {
  359. "instanceof": "Function"
  360. }
  361. ]
  362. },
  363. "filename": {
  364. "description": "Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files.",
  365. "anyOf": [
  366. {
  367. "type": "string"
  368. },
  369. {
  370. "instanceof": "Function"
  371. }
  372. ],
  373. "absolutePath": false
  374. },
  375. "hashDigest": {
  376. "description": "Digest type used for the hash",
  377. "enum": [
  378. "latin1",
  379. "hex",
  380. "base64"
  381. ]
  382. },
  383. "hashDigestLength": {
  384. "description": "Number of chars which are used for the hash",
  385. "minimum": 1,
  386. "type": "number"
  387. },
  388. "hashFunction": {
  389. "description": "Algorithm used for generation the hash (see node.js crypto package)",
  390. "minLength": 1,
  391. "type": "string"
  392. },
  393. "hashSalt": {
  394. "description": "Any string which is added to the hash to salt it",
  395. "minLength": 1,
  396. "type": "string"
  397. },
  398. "hotUpdateChunkFilename": {
  399. "description": "The filename of the Hot Update Chunks. They are inside the output.path directory.",
  400. "anyOf": [
  401. {
  402. "type": "string"
  403. },
  404. {
  405. "instanceof": "Function"
  406. }
  407. ],
  408. "absolutePath": false
  409. },
  410. "hotUpdateFunction": {
  411. "description": "The JSONP function used by webpack for async loading of hot update chunks.",
  412. "type": "string"
  413. },
  414. "hotUpdateMainFilename": {
  415. "description": "The filename of the Hot Update Main File. It is inside the `output.path` directory.",
  416. "anyOf": [
  417. {
  418. "type": "string"
  419. },
  420. {
  421. "instanceof": "Function"
  422. }
  423. ],
  424. "absolutePath": false
  425. },
  426. "jsonpFunction": {
  427. "description": "The JSONP function used by webpack for async loading of chunks.",
  428. "type": "string"
  429. },
  430. "library": {
  431. "anyOf": [
  432. {
  433. "type": "string"
  434. },
  435. {
  436. "items": {
  437. "description": "A part of the library name",
  438. "type": "string"
  439. },
  440. "type": "array"
  441. },
  442. {
  443. "type": "object",
  444. "additionalProperties": false,
  445. "properties": {
  446. "root": {
  447. "description": "Name of the property exposed globally by a UMD library",
  448. "type": "string"
  449. },
  450. "amd": {
  451. "description": "Name of the exposed AMD library in the UMD",
  452. "type": "string"
  453. },
  454. "commonjs": {
  455. "description": "Name of the exposed commonjs export in the UMD",
  456. "type": "string"
  457. }
  458. }
  459. }
  460. ],
  461. "description": "If set, export the bundle as library. `output.library` is the name."
  462. },
  463. "libraryTarget": {
  464. "description": "Type of library",
  465. "enum": [
  466. "var",
  467. "assign",
  468. "this",
  469. "window",
  470. "global",
  471. "commonjs",
  472. "commonjs2",
  473. "commonjs-module",
  474. "amd",
  475. "umd",
  476. "umd2",
  477. "jsonp"
  478. ]
  479. },
  480. "libraryExport": {
  481. "description": "Specify which export should be exposed as library",
  482. "anyOf": [
  483. {
  484. "type": "string"
  485. },
  486. {
  487. "$ref": "#/definitions/common.arrayOfStringValues"
  488. }
  489. ]
  490. },
  491. "path": {
  492. "description": "The output directory as **absolute path** (required).",
  493. "type": "string",
  494. "absolutePath": true
  495. },
  496. "pathinfo": {
  497. "description": "Include comments with information about the modules.",
  498. "type": "boolean"
  499. },
  500. "publicPath": {
  501. "description": "The `publicPath` specifies the public URL address of the output files when referenced in a browser.",
  502. "anyOf": [
  503. {
  504. "type": "string"
  505. },
  506. {
  507. "instanceof": "Function"
  508. }
  509. ]
  510. },
  511. "sourceMapFilename": {
  512. "description": "The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory.",
  513. "type": "string",
  514. "absolutePath": false
  515. },
  516. "sourcePrefix": {
  517. "description": "Prefixes every line of the source in the bundle with this string.",
  518. "type": "string"
  519. },
  520. "strictModuleExceptionHandling": {
  521. "description": "Handles exceptions in module loading correctly at a performance cost.",
  522. "type": "boolean"
  523. },
  524. "umdNamedDefine": {
  525. "description": "If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.",
  526. "type": "boolean"
  527. }
  528. },
  529. "type": "object"
  530. },
  531. "resolve": {
  532. "additionalProperties": false,
  533. "properties": {
  534. "alias": {
  535. "description": "Redirect module requests",
  536. "anyOf": [
  537. {
  538. "additionalProperties": {
  539. "description": "New request",
  540. "type": "string"
  541. },
  542. "type": "object"
  543. },
  544. {
  545. "items": {
  546. "description": "Alias configuration",
  547. "additionalProperties": false,
  548. "properties": {
  549. "alias": {
  550. "description": "New request",
  551. "type": "string"
  552. },
  553. "name": {
  554. "description": "Request to be redirected",
  555. "type": "string"
  556. },
  557. "onlyModule": {
  558. "description": "Redirect only exact matching request",
  559. "type": "boolean"
  560. }
  561. },
  562. "type": "object"
  563. },
  564. "type": "array"
  565. }
  566. ]
  567. },
  568. "aliasFields": {
  569. "description": "Fields in the description file (package.json) which are used to redirect requests inside the module",
  570. "anyOf": [
  571. {
  572. "$ref": "#/definitions/common.arrayOfStringOrStringArrayValues"
  573. }
  574. ]
  575. },
  576. "cachePredicate": {
  577. "description": "Predicate function to decide which requests should be cached",
  578. "instanceof": "Function"
  579. },
  580. "cacheWithContext": {
  581. "description": "Include the context information in the cache identifier when caching",
  582. "type": "boolean"
  583. },
  584. "descriptionFiles": {
  585. "description": "Filenames used to find a description file",
  586. "anyOf": [
  587. {
  588. "$ref": "#/definitions/common.arrayOfStringValues"
  589. }
  590. ]
  591. },
  592. "enforceExtension": {
  593. "description": "Enforce using one of the extensions from the extensions option",
  594. "type": "boolean"
  595. },
  596. "enforceModuleExtension": {
  597. "description": "Enforce using one of the module extensions from the moduleExtensions option",
  598. "type": "boolean"
  599. },
  600. "extensions": {
  601. "description": "Extensions added to the request when trying to find the file",
  602. "anyOf": [
  603. {
  604. "$ref": "#/definitions/common.arrayOfStringValues"
  605. }
  606. ]
  607. },
  608. "fileSystem": {
  609. "description": "Filesystem for the resolver"
  610. },
  611. "mainFields": {
  612. "description": "Field names from the description file (package.json) which are used to find the default entry point",
  613. "anyOf": [
  614. {
  615. "$ref": "#/definitions/common.arrayOfStringOrStringArrayValues"
  616. }
  617. ]
  618. },
  619. "mainFiles": {
  620. "description": "Filenames used to find the default entry point if there is no description file or main field",
  621. "anyOf": [
  622. {
  623. "$ref": "#/definitions/common.arrayOfStringValues"
  624. }
  625. ]
  626. },
  627. "moduleExtensions": {
  628. "description": "Extenstions added to the module request when trying to find the module",
  629. "anyOf": [
  630. {
  631. "$ref": "#/definitions/common.arrayOfStringValues"
  632. }
  633. ]
  634. },
  635. "modules": {
  636. "description": "Folder names or directory paths where to find modules",
  637. "anyOf": [
  638. {
  639. "$ref": "#/definitions/common.arrayOfStringValues"
  640. }
  641. ]
  642. },
  643. "plugins": {
  644. "description": "Plugins for the resolver",
  645. "type": "array"
  646. },
  647. "resolver": {
  648. "description": "Custom resolver"
  649. },
  650. "symlinks": {
  651. "description": "Enable resolving symlinks to the original location",
  652. "type": "boolean"
  653. },
  654. "unsafeCache": {
  655. "description": "Enable caching of successfully resolved requests",
  656. "anyOf": [
  657. {
  658. "type": "boolean"
  659. },
  660. {
  661. "additionalProperties": true,
  662. "type": "object"
  663. }
  664. ]
  665. },
  666. "useSyncFileSystemCalls": {
  667. "description": "Use synchronous filesystem calls for the resolver",
  668. "type": "boolean"
  669. }
  670. },
  671. "type": "object"
  672. },
  673. "ruleSet-condition": {
  674. "anyOf": [
  675. {
  676. "instanceof": "RegExp"
  677. },
  678. {
  679. "minLength": 1,
  680. "type": "string"
  681. },
  682. {
  683. "instanceof": "Function"
  684. },
  685. {
  686. "$ref": "#/definitions/ruleSet-conditions"
  687. },
  688. {
  689. "additionalProperties": false,
  690. "properties": {
  691. "and": {
  692. "description": "Logical AND",
  693. "anyOf": [
  694. {
  695. "$ref": "#/definitions/ruleSet-conditions"
  696. }
  697. ]
  698. },
  699. "exclude": {
  700. "description": "Exclude all modules matching any of these conditions",
  701. "anyOf": [
  702. {
  703. "$ref": "#/definitions/ruleSet-condition"
  704. }
  705. ]
  706. },
  707. "include": {
  708. "description": "Exclude all modules matching not any of these conditions",
  709. "anyOf": [
  710. {
  711. "$ref": "#/definitions/ruleSet-condition"
  712. }
  713. ]
  714. },
  715. "not": {
  716. "description": "Logical NOT",
  717. "anyOf": [
  718. {
  719. "$ref": "#/definitions/ruleSet-conditions"
  720. }
  721. ]
  722. },
  723. "or": {
  724. "description": "Logical OR",
  725. "anyOf": [
  726. {
  727. "$ref": "#/definitions/ruleSet-conditions"
  728. }
  729. ]
  730. },
  731. "test": {
  732. "description": "Exclude all modules matching any of these conditions",
  733. "anyOf": [
  734. {
  735. "$ref": "#/definitions/ruleSet-condition"
  736. }
  737. ]
  738. }
  739. },
  740. "type": "object"
  741. }
  742. ]
  743. },
  744. "ruleSet-conditions": {
  745. "items": {
  746. "description": "A rule condition",
  747. "anyOf": [
  748. {
  749. "$ref": "#/definitions/ruleSet-condition"
  750. }
  751. ]
  752. },
  753. "type": "array"
  754. },
  755. "ruleSet-loader": {
  756. "minLength": 1,
  757. "type": "string"
  758. },
  759. "ruleSet-query": {
  760. "anyOf": [
  761. {
  762. "type": "object"
  763. },
  764. {
  765. "type": "string"
  766. }
  767. ]
  768. },
  769. "ruleSet-rule": {
  770. "additionalProperties": false,
  771. "properties": {
  772. "enforce": {
  773. "description": "Enforce this rule as pre or post step",
  774. "enum": [
  775. "pre",
  776. "post"
  777. ]
  778. },
  779. "exclude": {
  780. "description": "Shortcut for resource.exclude",
  781. "allOf": [
  782. {
  783. "$ref": "#/definitions/ruleSet-condition"
  784. },
  785. {
  786. "absolutePath": true
  787. }
  788. ]
  789. },
  790. "include": {
  791. "description": "Shortcut for resource.include",
  792. "allOf": [
  793. {
  794. "$ref": "#/definitions/ruleSet-condition"
  795. },
  796. {
  797. "absolutePath": true
  798. }
  799. ]
  800. },
  801. "issuer": {
  802. "description": "Match the issuer of the module (The module pointing to this module)",
  803. "allOf": [
  804. {
  805. "$ref": "#/definitions/ruleSet-condition"
  806. },
  807. {
  808. "absolutePath": true
  809. }
  810. ]
  811. },
  812. "loader": {
  813. "description": "Shortcut for use.loader",
  814. "anyOf": [
  815. {
  816. "$ref": "#/definitions/ruleSet-loader"
  817. },
  818. {
  819. "$ref": "#/definitions/ruleSet-use"
  820. }
  821. ]
  822. },
  823. "loaders": {
  824. "description": "Shortcut for use.loader",
  825. "anyOf": [
  826. {
  827. "$ref": "#/definitions/ruleSet-use"
  828. }
  829. ]
  830. },
  831. "oneOf": {
  832. "description": "Only execute the first matching rule in this array",
  833. "anyOf": [
  834. {
  835. "$ref": "#/definitions/ruleSet-rules"
  836. }
  837. ]
  838. },
  839. "options": {
  840. "description": "Shortcut for use.options",
  841. "anyOf": [
  842. {
  843. "$ref": "#/definitions/ruleSet-query"
  844. }
  845. ]
  846. },
  847. "parser": {
  848. "description": "Options for parsing",
  849. "additionalProperties": true,
  850. "type": "object"
  851. },
  852. "query": {
  853. "description": "Shortcut for use.query",
  854. "anyOf": [
  855. {
  856. "$ref": "#/definitions/ruleSet-query"
  857. }
  858. ]
  859. },
  860. "resource": {
  861. "description": "Match the resource path of the module",
  862. "allOf": [
  863. {
  864. "$ref": "#/definitions/ruleSet-condition"
  865. },
  866. {
  867. "absolutePath": true
  868. }
  869. ]
  870. },
  871. "resourceQuery": {
  872. "description": "Match the resource query of the module",
  873. "anyOf": [
  874. {
  875. "$ref": "#/definitions/ruleSet-condition"
  876. }
  877. ]
  878. },
  879. "compiler": {
  880. "description": "Match the child compiler name",
  881. "anyOf": [
  882. {
  883. "$ref": "#/definitions/ruleSet-condition"
  884. }
  885. ]
  886. },
  887. "rules": {
  888. "description": "Match and execute these rules when this rule is matched",
  889. "anyOf": [
  890. {
  891. "$ref": "#/definitions/ruleSet-rules"
  892. }
  893. ]
  894. },
  895. "test": {
  896. "description": "Shortcut for resource.test",
  897. "allOf": [
  898. {
  899. "$ref": "#/definitions/ruleSet-condition"
  900. },
  901. {
  902. "absolutePath": true
  903. }
  904. ]
  905. },
  906. "use": {
  907. "description": "Modifiers applied to the module when rule is matched",
  908. "anyOf": [
  909. {
  910. "$ref": "#/definitions/ruleSet-use"
  911. }
  912. ]
  913. }
  914. },
  915. "type": "object"
  916. },
  917. "ruleSet-rules": {
  918. "items": {
  919. "description": "A rule",
  920. "anyOf": [
  921. {
  922. "$ref": "#/definitions/ruleSet-rule"
  923. }
  924. ]
  925. },
  926. "type": "array"
  927. },
  928. "ruleSet-use": {
  929. "anyOf": [
  930. {
  931. "$ref": "#/definitions/ruleSet-use-item"
  932. },
  933. {
  934. "instanceof": "Function"
  935. },
  936. {
  937. "items": {
  938. "description": "An use item",
  939. "anyOf": [
  940. {
  941. "$ref": "#/definitions/ruleSet-use-item"
  942. }
  943. ]
  944. },
  945. "type": "array"
  946. }
  947. ]
  948. },
  949. "ruleSet-use-item": {
  950. "anyOf": [
  951. {
  952. "$ref": "#/definitions/ruleSet-loader"
  953. },
  954. {
  955. "instanceof": "Function"
  956. },
  957. {
  958. "additionalProperties": false,
  959. "properties": {
  960. "loader": {
  961. "description": "Loader name",
  962. "anyOf": [
  963. {
  964. "$ref": "#/definitions/ruleSet-loader"
  965. }
  966. ]
  967. },
  968. "options": {
  969. "description": "Loader options",
  970. "anyOf": [
  971. {
  972. "$ref": "#/definitions/ruleSet-query"
  973. }
  974. ]
  975. },
  976. "ident": {
  977. "description": "Unique loader identifier",
  978. "type": "string"
  979. },
  980. "query": {
  981. "description": "Loader query",
  982. "anyOf": [
  983. {
  984. "$ref": "#/definitions/ruleSet-query"
  985. }
  986. ]
  987. }
  988. },
  989. "type": "object"
  990. }
  991. ]
  992. },
  993. "filter-item-types": {
  994. "anyOf": [
  995. {
  996. "instanceof": "RegExp"
  997. },
  998. {
  999. "type": "string"
  1000. },
  1001. {
  1002. "instanceof": "Function"
  1003. }
  1004. ]
  1005. },
  1006. "filter-types": {
  1007. "anyOf": [
  1008. {
  1009. "$ref": "#/definitions/filter-item-types"
  1010. },
  1011. {
  1012. "type": "array",
  1013. "items": {
  1014. "description": "Rule to filter",
  1015. "anyOf": [
  1016. {
  1017. "$ref": "#/definitions/filter-item-types"
  1018. }
  1019. ]
  1020. }
  1021. }
  1022. ]
  1023. }
  1024. },
  1025. "properties": {
  1026. "amd": {
  1027. "description": "Set the value of `require.amd` and `define.amd`."
  1028. },
  1029. "bail": {
  1030. "description": "Report the first error as a hard error instead of tolerating it.",
  1031. "type": "boolean"
  1032. },
  1033. "cache": {
  1034. "description": "Cache generated modules and chunks to improve performance for multiple incremental builds.",
  1035. "anyOf": [
  1036. {
  1037. "description": "You can pass `false` to disable it.",
  1038. "type": "boolean"
  1039. },
  1040. {
  1041. "description": "You can pass an object to enable it and let webpack use the passed object as cache. This way you can share the cache object between multiple compiler calls.",
  1042. "type": "object"
  1043. }
  1044. ]
  1045. },
  1046. "context": {
  1047. "description": "The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.",
  1048. "type": "string",
  1049. "absolutePath": true
  1050. },
  1051. "dependencies": {
  1052. "description": "References to other configurations to depend on.",
  1053. "items": {
  1054. "description": "References to another configuration to depend on.",
  1055. "type": "string"
  1056. },
  1057. "type": "array"
  1058. },
  1059. "devServer": {
  1060. "description": "Options for the webpack-dev-server",
  1061. "type": "object"
  1062. },
  1063. "devtool": {
  1064. "description": "A developer tool to enhance debugging.",
  1065. "anyOf": [
  1066. {
  1067. "type": "string"
  1068. },
  1069. {
  1070. "enum": [
  1071. false
  1072. ]
  1073. }
  1074. ]
  1075. },
  1076. "entry": {
  1077. "description": "The entry point(s) of the compilation.",
  1078. "anyOf": [
  1079. {
  1080. "$ref": "#/definitions/entry"
  1081. }
  1082. ]
  1083. },
  1084. "externals": {
  1085. "description": "Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.",
  1086. "anyOf": [
  1087. {
  1088. "$ref": "#/definitions/externals"
  1089. }
  1090. ]
  1091. },
  1092. "loader": {
  1093. "description": "Custom values available in the loader context.",
  1094. "type": "object"
  1095. },
  1096. "module": {
  1097. "description": "Options affecting the normal modules (`NormalModuleFactory`).",
  1098. "anyOf": [
  1099. {
  1100. "$ref": "#/definitions/module"
  1101. }
  1102. ]
  1103. },
  1104. "name": {
  1105. "description": "Name of the configuration. Used when loading multiple configurations.",
  1106. "type": "string"
  1107. },
  1108. "node": {
  1109. "description": "Include polyfills or mocks for various node stuff.",
  1110. "anyOf": [
  1111. {
  1112. "enum": [
  1113. false
  1114. ]
  1115. },
  1116. {
  1117. "additionalProperties": {
  1118. "description": "Include a polyfill for the node.js module",
  1119. "enum": [
  1120. false,
  1121. true,
  1122. "mock",
  1123. "empty"
  1124. ]
  1125. },
  1126. "properties": {
  1127. "Buffer": {
  1128. "description": "Include a polyfill for the 'Buffer' variable",
  1129. "enum": [
  1130. false,
  1131. true,
  1132. "mock"
  1133. ]
  1134. },
  1135. "__dirname": {
  1136. "description": "Include a polyfill for the '__dirname' variable",
  1137. "enum": [
  1138. false,
  1139. true,
  1140. "mock"
  1141. ]
  1142. },
  1143. "__filename": {
  1144. "description": "Include a polyfill for the '__filename' variable",
  1145. "enum": [
  1146. false,
  1147. true,
  1148. "mock"
  1149. ]
  1150. },
  1151. "console": {
  1152. "description": "Include a polyfill for the 'console' variable",
  1153. "enum": [
  1154. false,
  1155. true,
  1156. "mock"
  1157. ]
  1158. },
  1159. "global": {
  1160. "description": "Include a polyfill for the 'global' variable",
  1161. "type": "boolean"
  1162. },
  1163. "process": {
  1164. "description": "Include a polyfill for the 'process' variable",
  1165. "enum": [
  1166. false,
  1167. true,
  1168. "mock"
  1169. ]
  1170. }
  1171. },
  1172. "type": "object"
  1173. }
  1174. ]
  1175. },
  1176. "output": {
  1177. "description": "Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.",
  1178. "anyOf": [
  1179. {
  1180. "$ref": "#/definitions/output"
  1181. }
  1182. ]
  1183. },
  1184. "parallelism": {
  1185. "description": "The number of parallel processed modules in the compilation.",
  1186. "minimum": 1,
  1187. "type": "number"
  1188. },
  1189. "performance": {
  1190. "description": "Configuration for web performance recommendations.",
  1191. "anyOf": [
  1192. {
  1193. "enum": [
  1194. false
  1195. ]
  1196. },
  1197. {
  1198. "additionalProperties": false,
  1199. "properties": {
  1200. "assetFilter": {
  1201. "description": "Filter function to select assets that are checked",
  1202. "instanceof": "Function"
  1203. },
  1204. "hints": {
  1205. "description": "Sets the format of the hints: warnings, errors or nothing at all",
  1206. "enum": [
  1207. false,
  1208. "warning",
  1209. "error"
  1210. ]
  1211. },
  1212. "maxEntrypointSize": {
  1213. "description": "Total size of an entry point (in bytes)",
  1214. "type": "number"
  1215. },
  1216. "maxAssetSize": {
  1217. "description": "Filesize limit (in bytes) when exceeded, that webpack will provide performance hints",
  1218. "type": "number"
  1219. }
  1220. },
  1221. "type": "object"
  1222. }
  1223. ]
  1224. },
  1225. "plugins": {
  1226. "description": "Add additional plugins to the compiler.",
  1227. "type": "array"
  1228. },
  1229. "profile": {
  1230. "description": "Capture timing information for each module.",
  1231. "type": "boolean"
  1232. },
  1233. "recordsInputPath": {
  1234. "description": "Store compiler state to a json file.",
  1235. "type": "string",
  1236. "absolutePath": true
  1237. },
  1238. "recordsOutputPath": {
  1239. "description": "Load compiler state from a json file.",
  1240. "type": "string",
  1241. "absolutePath": true
  1242. },
  1243. "recordsPath": {
  1244. "description": "Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.",
  1245. "type": "string",
  1246. "absolutePath": true
  1247. },
  1248. "resolve": {
  1249. "description": "Options for the resolver",
  1250. "anyOf": [
  1251. {
  1252. "$ref": "#/definitions/resolve"
  1253. }
  1254. ]
  1255. },
  1256. "resolveLoader": {
  1257. "description": "Options for the resolver when resolving loaders",
  1258. "anyOf": [
  1259. {
  1260. "$ref": "#/definitions/resolve"
  1261. }
  1262. ]
  1263. },
  1264. "stats": {
  1265. "description": "Used by the webpack CLI program to pass stats options.",
  1266. "anyOf": [
  1267. {
  1268. "type": "object",
  1269. "additionalProperties": false,
  1270. "properties": {
  1271. "all": {
  1272. "type": "boolean",
  1273. "description": "fallback value for stats options when an option is not defined (has precedence over local webpack defaults)"
  1274. },
  1275. "context": {
  1276. "type": "string",
  1277. "description": "context directory for request shortening",
  1278. "absolutePath": true
  1279. },
  1280. "hash": {
  1281. "type": "boolean",
  1282. "description": "add the hash of the compilation"
  1283. },
  1284. "version": {
  1285. "type": "boolean",
  1286. "description": "add webpack version information"
  1287. },
  1288. "timings": {
  1289. "type": "boolean",
  1290. "description": "add timing information"
  1291. },
  1292. "performance": {
  1293. "type": "boolean",
  1294. "description": "add performance hint flags"
  1295. },
  1296. "depth": {
  1297. "type": "boolean",
  1298. "description": "add module depth in module graph"
  1299. },
  1300. "assets": {
  1301. "type": "boolean",
  1302. "description": "add assets information"
  1303. },
  1304. "env": {
  1305. "type": "boolean",
  1306. "description": "add --env information"
  1307. },
  1308. "colors": {
  1309. "description": "Enables/Disables colorful output",
  1310. "oneOf": [
  1311. {
  1312. "type": "boolean",
  1313. "description": "`webpack --colors` equivalent"
  1314. },
  1315. {
  1316. "type": "object",
  1317. "additionalProperties": false,
  1318. "properties": {
  1319. "bold": {
  1320. "description": "Custom color for bold text",
  1321. "type": "string"
  1322. },
  1323. "red": {
  1324. "description": "Custom color for red text",
  1325. "type": "string"
  1326. },
  1327. "green": {
  1328. "description": "Custom color for green text",
  1329. "type": "string"
  1330. },
  1331. "cyan": {
  1332. "description": "Custom color for cyan text",
  1333. "type": "string"
  1334. },
  1335. "magenta": {
  1336. "description": "Custom color for magenta text",
  1337. "type": "string"
  1338. },
  1339. "yellow": {
  1340. "description": "Custom color for yellow text",
  1341. "type": "string"
  1342. }
  1343. }
  1344. }
  1345. ]
  1346. },
  1347. "maxModules": {
  1348. "type": "number",
  1349. "description": "Set the maximum number of modules to be shown"
  1350. },
  1351. "chunks": {
  1352. "type": "boolean",
  1353. "description": "add chunk information"
  1354. },
  1355. "chunkModules": {
  1356. "type": "boolean",
  1357. "description": "add built modules information to chunk information"
  1358. },
  1359. "modules": {
  1360. "type": "boolean",
  1361. "description": "add built modules information"
  1362. },
  1363. "children": {
  1364. "type": "boolean",
  1365. "description": "add children information"
  1366. },
  1367. "cached": {
  1368. "type": "boolean",
  1369. "description": "add also information about cached (not built) modules"
  1370. },
  1371. "cachedAssets": {
  1372. "type": "boolean",
  1373. "description": "Show cached assets (setting this to `false` only shows emitted files)"
  1374. },
  1375. "reasons": {
  1376. "type": "boolean",
  1377. "description": "add information about the reasons why modules are included"
  1378. },
  1379. "source": {
  1380. "type": "boolean",
  1381. "description": "add the source code of modules"
  1382. },
  1383. "warnings": {
  1384. "type": "boolean",
  1385. "description": "add warnings"
  1386. },
  1387. "errors": {
  1388. "type": "boolean",
  1389. "description": "add errors"
  1390. },
  1391. "warningsFilter": {
  1392. "description": "Suppress warnings that match the specified filters. Filters can be Strings, RegExps or Functions",
  1393. "anyOf": [
  1394. {
  1395. "$ref": "#/definitions/filter-types"
  1396. }
  1397. ]
  1398. },
  1399. "excludeAssets": {
  1400. "description": "Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions",
  1401. "anyOf": [
  1402. {
  1403. "$ref": "#/definitions/filter-types"
  1404. }
  1405. ]
  1406. },
  1407. "excludeModules": {
  1408. "description": "Suppress modules that match the specified filters. Filters can be Strings, RegExps or Functions",
  1409. "anyOf": [
  1410. {
  1411. "$ref": "#/definitions/filter-types"
  1412. }
  1413. ]
  1414. },
  1415. "exclude": {
  1416. "description": "Please use excludeModules instead.",
  1417. "anyOf": [
  1418. {
  1419. "$ref": "#/definitions/filter-types"
  1420. }
  1421. ]
  1422. },
  1423. "entrypoints": {
  1424. "type": "boolean",
  1425. "description": "Display the entry points with the corresponding bundles"
  1426. },
  1427. "errorDetails": {
  1428. "type": "boolean",
  1429. "description": "add details to errors (like resolving log)"
  1430. },
  1431. "chunkOrigins": {
  1432. "type": "boolean",
  1433. "description": "add the origins of chunks and chunk merging info"
  1434. },
  1435. "modulesSort": {
  1436. "type": "string",
  1437. "description": "sort the modules by that field"
  1438. },
  1439. "moduleTrace": {
  1440. "type": "boolean",
  1441. "description": "add dependencies and origin of warnings/errors"
  1442. },
  1443. "chunksSort": {
  1444. "type": "string",
  1445. "description": "sort the chunks by that field"
  1446. },
  1447. "assetsSort": {
  1448. "type": "string",
  1449. "description": "sort the assets by that field"
  1450. },
  1451. "publicPath": {
  1452. "type": "boolean",
  1453. "description": "Add public path information"
  1454. },
  1455. "providedExports": {
  1456. "type": "boolean",
  1457. "description": "show exports provided by modules"
  1458. },
  1459. "usedExports": {
  1460. "type": "boolean",
  1461. "description": "show exports used by modules"
  1462. },
  1463. "optimizationBailout": {
  1464. "type": "boolean",
  1465. "description": "show reasons why optimization bailed out for modules"
  1466. }
  1467. }
  1468. },
  1469. {
  1470. "type": "boolean"
  1471. },
  1472. {
  1473. "enum": [
  1474. "none",
  1475. "errors-only",
  1476. "minimal",
  1477. "normal",
  1478. "detailed",
  1479. "verbose"
  1480. ]
  1481. }
  1482. ]
  1483. },
  1484. "target": {
  1485. "description": "Environment to build for",
  1486. "anyOf": [
  1487. {
  1488. "enum": [
  1489. "web",
  1490. "webworker",
  1491. "node",
  1492. "async-node",
  1493. "node-webkit",
  1494. "atom",
  1495. "electron",
  1496. "electron-main",
  1497. "electron-renderer"
  1498. ]
  1499. },
  1500. {
  1501. "instanceof": "Function"
  1502. }
  1503. ]
  1504. },
  1505. "watch": {
  1506. "description": "Enter watch mode, which rebuilds on file change.",
  1507. "type": "boolean"
  1508. },
  1509. "watchOptions": {
  1510. "description": "Options for the watcher",
  1511. "additionalProperties": false,
  1512. "properties": {
  1513. "aggregateTimeout": {
  1514. "description": "Delay the rebuilt after the first change. Value is a time in ms.",
  1515. "type": "number"
  1516. },
  1517. "ignored": {
  1518. "description": "Ignore some files from watching"
  1519. },
  1520. "stdin": {
  1521. "description": "Stop watching when stdin stream has ended",
  1522. "type": "boolean"
  1523. },
  1524. "poll": {
  1525. "description": "Enable polling mode for watching",
  1526. "anyOf": [
  1527. {
  1528. "description": "`true`: use polling.",
  1529. "type": "boolean"
  1530. },
  1531. {
  1532. "description": "`number`: use polling with specified interval.",
  1533. "type": "number"
  1534. }
  1535. ]
  1536. }
  1537. },
  1538. "type": "object"
  1539. }
  1540. },
  1541. "required": [
  1542. "entry"
  1543. ],
  1544. "type": "object"
  1545. }