You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WebpackOptions.d.ts 36KB

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