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.

1446 lines
36 KiB

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