UNPKG

401 kBTypeScriptView Raw
1/*
2 * This file was automatically generated.
3 * DO NOT MODIFY BY HAND.
4 * Run `yarn special-lint-fix` to update
5 */
6
7import { Buffer } from "buffer";
8import {
9 ArrayExpression,
10 ArrayPattern,
11 ArrowFunctionExpression,
12 AssignmentExpression,
13 AssignmentPattern,
14 AssignmentProperty,
15 AwaitExpression,
16 BigIntLiteral,
17 BinaryExpression,
18 BlockStatement,
19 BreakStatement,
20 CatchClause,
21 ChainExpression,
22 ClassBody,
23 ClassDeclaration,
24 ClassExpression,
25 Comment,
26 ConditionalExpression,
27 ContinueStatement,
28 DebuggerStatement,
29 Directive,
30 DoWhileStatement,
31 EmptyStatement,
32 ExportAllDeclaration,
33 ExportDefaultDeclaration,
34 ExportNamedDeclaration,
35 ExportSpecifier,
36 ExpressionStatement,
37 ForInStatement,
38 ForOfStatement,
39 ForStatement,
40 FunctionDeclaration,
41 FunctionExpression,
42 Identifier,
43 IfStatement,
44 ImportDeclaration,
45 ImportDefaultSpecifier,
46 ImportExpression,
47 ImportNamespaceSpecifier,
48 ImportSpecifier,
49 LabeledStatement,
50 LogicalExpression,
51 MemberExpression,
52 MetaProperty,
53 MethodDefinition,
54 NewExpression,
55 ObjectExpression,
56 ObjectPattern,
57 PrivateIdentifier,
58 Program,
59 Property,
60 PropertyDefinition,
61 RegExpLiteral,
62 RestElement,
63 ReturnStatement,
64 SequenceExpression,
65 SimpleCallExpression,
66 SimpleLiteral,
67 SpreadElement,
68 StaticBlock,
69 Super,
70 SwitchCase,
71 SwitchStatement,
72 TaggedTemplateExpression,
73 TemplateElement,
74 TemplateLiteral,
75 ThisExpression,
76 ThrowStatement,
77 TryStatement,
78 UnaryExpression,
79 UpdateExpression,
80 VariableDeclaration,
81 VariableDeclarator,
82 WhileStatement,
83 WithStatement,
84 YieldExpression
85} from "estree";
86import {
87 IncomingMessage,
88 ServerOptions as ServerOptionsImport,
89 ServerResponse
90} from "http";
91import { ListenOptions, Server } from "net";
92import { validate as validateFunction } from "schema-utils";
93import { default as ValidationError } from "schema-utils/declarations/ValidationError";
94import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
95import {
96 AsArray,
97 AsyncParallelHook,
98 AsyncSeriesBailHook,
99 AsyncSeriesHook,
100 AsyncSeriesWaterfallHook,
101 HookMap,
102 IfSet,
103 MultiHook,
104 SyncBailHook,
105 SyncHook,
106 SyncWaterfallHook,
107 TapOptions
108} from "tapable";
109import { SecureContextOptions, TlsOptions } from "tls";
110import { URL } from "url";
111import { Context } from "vm";
112
113declare interface Abortable {
114 /**
115 * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
116 */
117 signal?: AbortSignal;
118}
119declare class AbstractLibraryPlugin<T> {
120 constructor(__0: {
121 /**
122 * name of the plugin
123 */
124 pluginName: string;
125 /**
126 * used library type
127 */
128 type: string;
129 });
130
131 /**
132 * Apply the plugin
133 */
134 apply(compiler: Compiler): void;
135 parseOptions(library: LibraryOptions): false | T;
136 finishEntryModule(
137 module: Module,
138 entryName: string,
139 libraryContext: LibraryContext<T>
140 ): void;
141 embedInRuntimeBailout(
142 module: Module,
143 renderContext: RenderContext,
144 libraryContext: LibraryContext<T>
145 ): undefined | string;
146 strictRuntimeBailout(
147 renderContext: RenderContext,
148 libraryContext: LibraryContext<T>
149 ): undefined | string;
150 runtimeRequirements(
151 chunk: Chunk,
152 set: Set<string>,
153 libraryContext: LibraryContext<T>
154 ): void;
155 render(
156 source: Source,
157 renderContext: RenderContext,
158 libraryContext: LibraryContext<T>
159 ): Source;
160 renderStartup(
161 source: Source,
162 module: Module,
163 renderContext: StartupRenderContext,
164 libraryContext: LibraryContext<T>
165 ): Source;
166 chunkHash(
167 chunk: Chunk,
168 hash: Hash,
169 chunkHashContext: ChunkHashContext,
170 libraryContext: LibraryContext<T>
171 ): void;
172 static COMMON_LIBRARY_NAME_MESSAGE: string;
173}
174declare interface AdditionalData {
175 [index: string]: any;
176 webpackAST: object;
177}
178declare class AggressiveMergingPlugin {
179 constructor(options?: AggressiveMergingPluginOptions);
180 options: AggressiveMergingPluginOptions;
181
182 /**
183 * Apply the plugin
184 */
185 apply(compiler: Compiler): void;
186}
187declare interface AggressiveMergingPluginOptions {
188 /**
189 * minimal size reduction to trigger merging
190 */
191 minSizeReduce?: number;
192}
193declare class AggressiveSplittingPlugin {
194 constructor(options?: AggressiveSplittingPluginOptions);
195 options: AggressiveSplittingPluginOptions;
196
197 /**
198 * Apply the plugin
199 */
200 apply(compiler: Compiler): void;
201 static wasChunkRecorded(chunk: Chunk): boolean;
202}
203declare interface AggressiveSplittingPluginOptions {
204 /**
205 * Extra cost for each chunk (Default: 9.8kiB).
206 */
207 chunkOverhead?: number;
208
209 /**
210 * Extra cost multiplicator for entry chunks (Default: 10).
211 */
212 entryChunkMultiplicator?: number;
213
214 /**
215 * Byte, max size of per file (Default: 50kiB).
216 */
217 maxSize?: number;
218
219 /**
220 * Byte, split point. (Default: 30kiB).
221 */
222 minSize?: number;
223}
224type Algorithm = string | typeof Hash;
225type Alias = string | false | string[];
226declare interface AliasOption {
227 alias: Alias;
228 name: string;
229 onlyModule?: boolean;
230}
231type AliasOptionNewRequest = string | false | string[];
232declare interface AliasOptions {
233 [index: string]: AliasOptionNewRequest;
234}
235declare interface Argument {
236 description?: string;
237 simpleType: SimpleType;
238 multiple: boolean;
239 configs: ArgumentConfig[];
240}
241declare interface ArgumentConfig {
242 description?: string;
243 negatedDescription?: string;
244 path: string;
245 multiple: boolean;
246 type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
247 values?: any[];
248}
249type ArrayBufferView =
250 | Uint8Array
251 | Uint8ClampedArray
252 | Uint16Array
253 | Uint32Array
254 | Int8Array
255 | Int16Array
256 | Int32Array
257 | BigUint64Array
258 | BigInt64Array
259 | Float32Array
260 | Float64Array
261 | DataView;
262declare interface Asset {
263 /**
264 * the filename of the asset
265 */
266 name: string;
267
268 /**
269 * source of the asset
270 */
271 source: Source;
272
273 /**
274 * info about the asset
275 */
276 info: AssetInfo;
277}
278declare interface AssetEmittedInfo {
279 content: Buffer;
280 source: Source;
281 compilation: Compilation;
282 outputPath: string;
283 targetPath: string;
284}
285type AssetFilterItemTypes =
286 | string
287 | RegExp
288 | ((name: string, asset: StatsAsset) => boolean);
289
290/**
291 * Options object for data url generation.
292 */
293declare interface AssetGeneratorDataUrlOptions {
294 /**
295 * Asset encoding (defaults to base64).
296 */
297 encoding?: false | "base64";
298
299 /**
300 * Asset mimetype (getting from file extension by default).
301 */
302 mimetype?: string;
303}
304type AssetGeneratorOptions = AssetInlineGeneratorOptions &
305 AssetResourceGeneratorOptions;
306type AssetInfo = KnownAssetInfo & Record<string, any>;
307
308/**
309 * Generator options for asset/inline modules.
310 */
311declare interface AssetInlineGeneratorOptions {
312 /**
313 * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
314 */
315 binary?: boolean;
316
317 /**
318 * The options for data url generator.
319 */
320 dataUrl?:
321 | AssetGeneratorDataUrlOptions
322 | ((
323 source: string | Buffer,
324 context: { filename: string; module: Module }
325 ) => string);
326}
327
328/**
329 * Options object for DataUrl condition.
330 */
331declare interface AssetParserDataUrlOptions {
332 /**
333 * Maximum size of asset that should be inline as modules. Default: 8kb.
334 */
335 maxSize?: number;
336}
337
338/**
339 * Parser options for asset modules.
340 */
341declare interface AssetParserOptions {
342 /**
343 * The condition for inlining the asset as DataUrl.
344 */
345 dataUrlCondition?:
346 | AssetParserDataUrlOptions
347 | ((
348 source: string | Buffer,
349 context: { filename: string; module: Module }
350 ) => boolean);
351}
352
353/**
354 * Generator options for asset/resource modules.
355 */
356declare interface AssetResourceGeneratorOptions {
357 /**
358 * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
359 */
360 binary?: boolean;
361
362 /**
363 * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
364 */
365 emit?: boolean;
366
367 /**
368 * Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
369 */
370 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
371
372 /**
373 * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
374 */
375 outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
376
377 /**
378 * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
379 */
380 publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
381}
382declare class AsyncDependenciesBlock extends DependenciesBlock {
383 constructor(
384 groupOptions:
385 | null
386 | (RawChunkGroupOptions & { name?: string } & {
387 entryOptions?: EntryOptions;
388 }),
389 loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
390 request?: null | string
391 );
392 groupOptions: RawChunkGroupOptions & { name?: string } & {
393 entryOptions?: EntryOptions;
394 };
395 loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
396 request?: null | string;
397 chunkName?: string;
398 module: any;
399}
400declare abstract class AsyncQueue<T, K, R> {
401 hooks: {
402 beforeAdd: AsyncSeriesHook<[T]>;
403 added: SyncHook<[T]>;
404 beforeStart: AsyncSeriesHook<[T]>;
405 started: SyncHook<[T]>;
406 result: SyncHook<
407 [T, undefined | null | WebpackError, undefined | null | R]
408 >;
409 };
410 add(item: T, callback: CallbackAsyncQueue<R>): void;
411 invalidate(item: T): void;
412
413 /**
414 * Waits for an already started item
415 */
416 waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
417 stop(): void;
418 increaseParallelism(): void;
419 decreaseParallelism(): void;
420 isProcessing(item: T): boolean;
421 isQueued(item: T): boolean;
422 isDone(item: T): boolean;
423 clear(): void;
424}
425declare class AsyncWebAssemblyModulesPlugin {
426 constructor(options: AsyncWebAssemblyModulesPluginOptions);
427 options: AsyncWebAssemblyModulesPluginOptions;
428
429 /**
430 * Apply the plugin
431 */
432 apply(compiler: Compiler): void;
433 renderModule(
434 module: Module,
435 renderContext: WebAssemblyRenderContext,
436 hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
437 ): Source;
438 static getCompilationHooks(
439 compilation: Compilation
440 ): CompilationHooksAsyncWebAssemblyModulesPlugin;
441}
442declare interface AsyncWebAssemblyModulesPluginOptions {
443 /**
444 * mangle imports
445 */
446 mangleImports?: boolean;
447}
448declare class AutomaticPrefetchPlugin {
449 constructor();
450
451 /**
452 * Apply the plugin
453 */
454 apply(compiler: Compiler): void;
455}
456type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
457declare interface BackendApi {
458 dispose: (arg0: (arg0?: null | Error) => void) => void;
459 module: (arg0: Module) => ModuleResult;
460}
461declare class BannerPlugin {
462 constructor(options: BannerPluginArgument);
463 options: BannerPluginOptions;
464 banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
465
466 /**
467 * Apply the plugin
468 */
469 apply(compiler: Compiler): void;
470}
471type BannerPluginArgument =
472 | string
473 | BannerPluginOptions
474 | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
475declare interface BannerPluginOptions {
476 /**
477 * Specifies the banner.
478 */
479 banner:
480 | string
481 | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
482
483 /**
484 * If true, the banner will only be added to the entry chunks.
485 */
486 entryOnly?: boolean;
487
488 /**
489 * Exclude all modules matching any of these conditions.
490 */
491 exclude?: string | RegExp | Rule[];
492
493 /**
494 * If true, banner will be placed at the end of the output.
495 */
496 footer?: boolean;
497
498 /**
499 * Include all modules matching any of these conditions.
500 */
501 include?: string | RegExp | Rule[];
502
503 /**
504 * If true, banner will not be wrapped in a comment.
505 */
506 raw?: boolean;
507
508 /**
509 * Specifies the banner.
510 */
511 stage?: number;
512
513 /**
514 * Include all modules that pass test assertion.
515 */
516 test?: string | RegExp | Rule[];
517}
518declare interface BaseResolveRequest {
519 path: string | false;
520 context?: object;
521 descriptionFilePath?: string;
522 descriptionFileRoot?: string;
523 descriptionFileData?: JsonObjectTypes;
524 relativePath?: string;
525 ignoreSymlinks?: boolean;
526 fullySpecified?: boolean;
527 __innerRequest?: string;
528 __innerRequest_request?: string;
529 __innerRequest_relativePath?: string;
530}
531declare abstract class BasicEvaluatedExpression {
532 type: number;
533 range?: [number, number];
534 falsy: boolean;
535 truthy: boolean;
536 nullish?: boolean;
537 sideEffects: boolean;
538 bool?: boolean;
539 number?: number;
540 bigint?: bigint;
541 regExp?: RegExp;
542 string?: string;
543 quasis?: BasicEvaluatedExpression[];
544 parts?: BasicEvaluatedExpression[];
545 array?: any[];
546 items?: BasicEvaluatedExpression[];
547 options?: BasicEvaluatedExpression[];
548 prefix?: null | BasicEvaluatedExpression;
549 postfix?: null | BasicEvaluatedExpression;
550 wrappedInnerExpressions?: BasicEvaluatedExpression[];
551 identifier?: string | VariableInfoInterface;
552 rootInfo?: string | VariableInfoInterface;
553 getMembers?: () => string[];
554 getMembersOptionals?: () => boolean[];
555 getMemberRanges?: () => [number, number][];
556 expression?:
557 | UnaryExpression
558 | ArrayExpression
559 | ArrowFunctionExpression
560 | AssignmentExpression
561 | AwaitExpression
562 | BinaryExpression
563 | SimpleCallExpression
564 | NewExpression
565 | ChainExpression
566 | ClassExpression
567 | ConditionalExpression
568 | FunctionExpression
569 | Identifier
570 | ImportExpression
571 | SimpleLiteral
572 | RegExpLiteral
573 | BigIntLiteral
574 | LogicalExpression
575 | MemberExpression
576 | MetaProperty
577 | ObjectExpression
578 | SequenceExpression
579 | TaggedTemplateExpression
580 | TemplateLiteral
581 | ThisExpression
582 | UpdateExpression
583 | YieldExpression
584 | SpreadElement
585 | FunctionDeclaration
586 | VariableDeclaration
587 | ClassDeclaration
588 | PrivateIdentifier
589 | ExpressionStatement
590 | BlockStatement
591 | StaticBlock
592 | EmptyStatement
593 | DebuggerStatement
594 | WithStatement
595 | ReturnStatement
596 | LabeledStatement
597 | BreakStatement
598 | ContinueStatement
599 | IfStatement
600 | SwitchStatement
601 | ThrowStatement
602 | TryStatement
603 | WhileStatement
604 | DoWhileStatement
605 | ForStatement
606 | ForInStatement
607 | ForOfStatement
608 | ImportDeclaration
609 | ExportNamedDeclaration
610 | ExportDefaultDeclaration
611 | ExportAllDeclaration
612 | MethodDefinition
613 | PropertyDefinition
614 | VariableDeclarator
615 | Program
616 | SwitchCase
617 | CatchClause
618 | ObjectPattern
619 | ArrayPattern
620 | RestElement
621 | AssignmentPattern
622 | Property
623 | AssignmentProperty
624 | ClassBody
625 | ImportSpecifier
626 | ImportDefaultSpecifier
627 | ImportNamespaceSpecifier
628 | ExportSpecifier
629 | Super
630 | TemplateElement;
631 isUnknown(): boolean;
632 isNull(): boolean;
633 isUndefined(): boolean;
634 isString(): boolean;
635 isNumber(): boolean;
636 isBigInt(): boolean;
637 isBoolean(): boolean;
638 isRegExp(): boolean;
639 isConditional(): boolean;
640 isArray(): boolean;
641 isConstArray(): boolean;
642 isIdentifier(): boolean;
643 isWrapped(): boolean;
644 isTemplateString(): boolean;
645
646 /**
647 * Is expression a primitive or an object type value?
648 */
649 isPrimitiveType(): undefined | boolean;
650
651 /**
652 * Is expression a runtime or compile-time value?
653 */
654 isCompileTimeValue(): boolean;
655
656 /**
657 * Gets the compile-time value of the expression
658 */
659 asCompileTimeValue(): any;
660 isTruthy(): boolean;
661 isFalsy(): boolean;
662 isNullish(): undefined | boolean;
663
664 /**
665 * Can this expression have side effects?
666 */
667 couldHaveSideEffects(): boolean;
668
669 /**
670 * Creates a boolean representation of this evaluated expression.
671 */
672 asBool(): undefined | boolean;
673
674 /**
675 * Creates a nullish coalescing representation of this evaluated expression.
676 */
677 asNullish(): undefined | boolean;
678
679 /**
680 * Creates a string representation of this evaluated expression.
681 */
682 asString(): undefined | string;
683 setString(string: string): BasicEvaluatedExpression;
684 setUndefined(): BasicEvaluatedExpression;
685 setNull(): BasicEvaluatedExpression;
686
687 /**
688 * Set's the value of this expression to a number
689 */
690 setNumber(number: number): BasicEvaluatedExpression;
691
692 /**
693 * Set's the value of this expression to a BigInt
694 */
695 setBigInt(bigint: bigint): BasicEvaluatedExpression;
696
697 /**
698 * Set's the value of this expression to a boolean
699 */
700 setBoolean(bool: boolean): BasicEvaluatedExpression;
701
702 /**
703 * Set's the value of this expression to a regular expression
704 */
705 setRegExp(regExp: RegExp): BasicEvaluatedExpression;
706
707 /**
708 * Set's the value of this expression to a particular identifier and its members.
709 */
710 setIdentifier(
711 identifier: string | VariableInfoInterface,
712 rootInfo: string | VariableInfoInterface,
713 getMembers: () => string[],
714 getMembersOptionals?: () => boolean[],
715 getMemberRanges?: () => [number, number][]
716 ): BasicEvaluatedExpression;
717
718 /**
719 * Wraps an array of expressions with a prefix and postfix expression.
720 */
721 setWrapped(
722 prefix?: null | BasicEvaluatedExpression,
723 postfix?: null | BasicEvaluatedExpression,
724 innerExpressions?: BasicEvaluatedExpression[]
725 ): BasicEvaluatedExpression;
726
727 /**
728 * Stores the options of a conditional expression.
729 */
730 setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
731
732 /**
733 * Adds options to a conditional expression.
734 */
735 addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
736
737 /**
738 * Set's the value of this expression to an array of expressions.
739 */
740 setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
741
742 /**
743 * Set's the value of this expression to an array of strings.
744 */
745 setArray(array: string[]): BasicEvaluatedExpression;
746
747 /**
748 * Set's the value of this expression to a processed/unprocessed template string. Used
749 * for evaluating TemplateLiteral expressions in the JavaScript Parser.
750 */
751 setTemplateString(
752 quasis: BasicEvaluatedExpression[],
753 parts: BasicEvaluatedExpression[],
754 kind: "raw" | "cooked"
755 ): BasicEvaluatedExpression;
756 templateStringKind?: "raw" | "cooked";
757 setTruthy(): BasicEvaluatedExpression;
758 setFalsy(): BasicEvaluatedExpression;
759
760 /**
761 * Set's the value of the expression to nullish.
762 */
763 setNullish(value: boolean): BasicEvaluatedExpression;
764
765 /**
766 * Set's the range for the expression.
767 */
768 setRange(range: [number, number]): BasicEvaluatedExpression;
769
770 /**
771 * Set whether or not the expression has side effects.
772 */
773 setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
774
775 /**
776 * Set the expression node for the expression.
777 */
778 setExpression(
779 expression?:
780 | UnaryExpression
781 | ArrayExpression
782 | ArrowFunctionExpression
783 | AssignmentExpression
784 | AwaitExpression
785 | BinaryExpression
786 | SimpleCallExpression
787 | NewExpression
788 | ChainExpression
789 | ClassExpression
790 | ConditionalExpression
791 | FunctionExpression
792 | Identifier
793 | ImportExpression
794 | SimpleLiteral
795 | RegExpLiteral
796 | BigIntLiteral
797 | LogicalExpression
798 | MemberExpression
799 | MetaProperty
800 | ObjectExpression
801 | SequenceExpression
802 | TaggedTemplateExpression
803 | TemplateLiteral
804 | ThisExpression
805 | UpdateExpression
806 | YieldExpression
807 | SpreadElement
808 | FunctionDeclaration
809 | VariableDeclaration
810 | ClassDeclaration
811 | PrivateIdentifier
812 | ExpressionStatement
813 | BlockStatement
814 | StaticBlock
815 | EmptyStatement
816 | DebuggerStatement
817 | WithStatement
818 | ReturnStatement
819 | LabeledStatement
820 | BreakStatement
821 | ContinueStatement
822 | IfStatement
823 | SwitchStatement
824 | ThrowStatement
825 | TryStatement
826 | WhileStatement
827 | DoWhileStatement
828 | ForStatement
829 | ForInStatement
830 | ForOfStatement
831 | ImportDeclaration
832 | ExportNamedDeclaration
833 | ExportDefaultDeclaration
834 | ExportAllDeclaration
835 | MethodDefinition
836 | PropertyDefinition
837 | VariableDeclarator
838 | Program
839 | SwitchCase
840 | CatchClause
841 | ObjectPattern
842 | ArrayPattern
843 | RestElement
844 | AssignmentPattern
845 | Property
846 | AssignmentProperty
847 | ClassBody
848 | ImportSpecifier
849 | ImportDefaultSpecifier
850 | ImportNamespaceSpecifier
851 | ExportSpecifier
852 | Super
853 | TemplateElement
854 ): BasicEvaluatedExpression;
855}
856declare interface Bootstrap {
857 header: string[];
858 beforeStartup: string[];
859 startup: string[];
860 afterStartup: string[];
861 allowInlineStartup: boolean;
862}
863type BufferEncoding =
864 | "ascii"
865 | "utf8"
866 | "utf-8"
867 | "utf16le"
868 | "utf-16le"
869 | "ucs2"
870 | "ucs-2"
871 | "latin1"
872 | "binary"
873 | "base64"
874 | "base64url"
875 | "hex";
876type BufferEncodingOption = "buffer" | { encoding: "buffer" };
877type BuildInfo = KnownBuildInfo & Record<string, any>;
878type BuildMeta = KnownBuildMeta & Record<string, any>;
879declare abstract class ByTypeGenerator extends Generator {
880 map: Record<string, Generator>;
881}
882declare const CIRCULAR_CONNECTION: unique symbol;
883declare class Cache {
884 constructor();
885 hooks: {
886 get: AsyncSeriesBailHook<
887 [
888 string,
889 null | Etag,
890 ((result: any, callback: (arg0?: Error) => void) => void)[]
891 ],
892 any
893 >;
894 store: AsyncParallelHook<[string, null | Etag, any]>;
895 storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
896 beginIdle: SyncHook<[]>;
897 endIdle: AsyncParallelHook<[]>;
898 shutdown: AsyncParallelHook<[]>;
899 };
900 get<T>(
901 identifier: string,
902 etag: null | Etag,
903 callback: CallbackCacheCache<T>
904 ): void;
905 store<T>(
906 identifier: string,
907 etag: null | Etag,
908 data: T,
909 callback: CallbackCacheCache<void>
910 ): void;
911
912 /**
913 * After this method has succeeded the cache can only be restored when build dependencies are
914 */
915 storeBuildDependencies(
916 dependencies: Iterable<string>,
917 callback: CallbackCacheCache<void>
918 ): void;
919 beginIdle(): void;
920 endIdle(callback: CallbackCacheCache<void>): void;
921 shutdown(callback: CallbackCacheCache<void>): void;
922 static STAGE_MEMORY: number;
923 static STAGE_DEFAULT: number;
924 static STAGE_DISK: number;
925 static STAGE_NETWORK: number;
926}
927declare abstract class CacheFacade {
928 getChildCache(name: string): CacheFacade;
929 getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
930 getLazyHashedEtag(obj: HashableObject): Etag;
931 mergeEtags(a: Etag, b: Etag): Etag;
932 get<T>(
933 identifier: string,
934 etag: null | Etag,
935 callback: CallbackCacheCacheFacade<T>
936 ): void;
937 getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
938 store<T>(
939 identifier: string,
940 etag: null | Etag,
941 data: T,
942 callback: CallbackCacheCacheFacade<void>
943 ): void;
944 storePromise<T>(
945 identifier: string,
946 etag: null | Etag,
947 data: T
948 ): Promise<void>;
949 provide<T>(
950 identifier: string,
951 etag: null | Etag,
952 computer: (arg0: CallbackNormalErrorCache<T>) => void,
953 callback: CallbackNormalErrorCache<T>
954 ): void;
955 providePromise<T>(
956 identifier: string,
957 etag: null | Etag,
958 computer: () => T | Promise<T>
959 ): Promise<T>;
960}
961declare interface CacheGroupSource {
962 key?: string;
963 priority?: number;
964 getName?: (
965 module?: Module,
966 chunks?: Chunk[],
967 key?: string
968 ) => undefined | string;
969 chunksFilter?: (chunk: Chunk) => undefined | boolean;
970 enforce?: boolean;
971 minSize: SplitChunksSizes;
972 minSizeReduction: SplitChunksSizes;
973 minRemainingSize: SplitChunksSizes;
974 enforceSizeThreshold: SplitChunksSizes;
975 maxAsyncSize: SplitChunksSizes;
976 maxInitialSize: SplitChunksSizes;
977 minChunks?: number;
978 maxAsyncRequests?: number;
979 maxInitialRequests?: number;
980 filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
981 idHint?: string;
982 automaticNameDelimiter?: string;
983 reuseExistingChunk?: boolean;
984 usedExports?: boolean;
985}
986declare interface CacheGroupsContext {
987 moduleGraph: ModuleGraph;
988 chunkGraph: ChunkGraph;
989}
990type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
991declare class CachedSource extends Source {
992 constructor(source: Source);
993 constructor(source: Source | (() => Source), cachedData?: any);
994 original(): Source;
995 originalLazy(): Source | (() => Source);
996 getCachedData(): any;
997}
998type CallExpression = SimpleCallExpression | NewExpression;
999declare interface CallExpressionInfo {
1000 type: "call";
1001 call: CallExpression;
1002 calleeName: string;
1003 rootInfo: string | VariableInfo;
1004 getCalleeMembers: () => string[];
1005 name: string;
1006 getMembers: () => string[];
1007 getMembersOptionals: () => boolean[];
1008 getMemberRanges: () => [number, number][];
1009}
1010declare interface CallbackAsyncQueue<T> {
1011 (err?: null | WebpackError, result?: null | T): any;
1012}
1013declare interface CallbackCacheCache<T> {
1014 (err: null | WebpackError, result?: T): void;
1015}
1016declare interface CallbackCacheCacheFacade<T> {
1017 (err?: null | Error, result?: null | T): void;
1018}
1019declare interface CallbackFunction_1<T> {
1020 (err: null | Error, result?: T): any;
1021}
1022declare interface CallbackFunction_2<T> {
1023 (err?: null | Error, result?: T): any;
1024}
1025declare interface CallbackNormalErrorCache<T> {
1026 (err?: null | Error, result?: T): void;
1027}
1028declare interface CallbackNormalModuleFactory<T> {
1029 (err?: null | Error, stats?: T): void;
1030}
1031declare interface CallbackWebpack<T> {
1032 (err: null | Error, stats?: T): void;
1033}
1034type Cell<T> = undefined | T;
1035declare class Chunk {
1036 constructor(name?: string, backCompat?: boolean);
1037 id: null | string | number;
1038 ids: null | ChunkId[];
1039 debugId: number;
1040 name?: string;
1041 idNameHints: SortableSet<string>;
1042 preventIntegration: boolean;
1043 filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
1044 cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
1045 runtime: RuntimeSpec;
1046 files: Set<string>;
1047 auxiliaryFiles: Set<string>;
1048 rendered: boolean;
1049 hash?: string;
1050 contentHash: Record<string, string>;
1051 renderedHash?: string;
1052 chunkReason?: string;
1053 extraAsync: boolean;
1054 get entryModule(): Module;
1055 hasEntryModule(): boolean;
1056 addModule(module: Module): boolean;
1057 removeModule(module: Module): void;
1058 getNumberOfModules(): number;
1059 get modulesIterable(): Iterable<Module>;
1060 compareTo(otherChunk: Chunk): 0 | 1 | -1;
1061 containsModule(module: Module): boolean;
1062 getModules(): Module[];
1063 remove(): void;
1064 moveModule(module: Module, otherChunk: Chunk): void;
1065 integrate(otherChunk: Chunk): boolean;
1066 canBeIntegrated(otherChunk: Chunk): boolean;
1067 isEmpty(): boolean;
1068 modulesSize(): number;
1069 size(options?: ChunkSizeOptions): number;
1070 integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
1071 getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
1072 hasModuleInGraph(
1073 filterFn: (m: Module) => boolean,
1074 filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1075 ): boolean;
1076 getChunkMaps(realHash: boolean): ChunkMaps;
1077 hasRuntime(): boolean;
1078 canBeInitial(): boolean;
1079 isOnlyInitial(): boolean;
1080 getEntryOptions(): undefined | EntryOptions;
1081 addGroup(chunkGroup: ChunkGroup): void;
1082 removeGroup(chunkGroup: ChunkGroup): void;
1083 isInGroup(chunkGroup: ChunkGroup): boolean;
1084 getNumberOfGroups(): number;
1085 get groupsIterable(): SortableSet<ChunkGroup>;
1086 disconnectFromGroups(): void;
1087 split(newChunk: Chunk): void;
1088 updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
1089 getAllAsyncChunks(): Set<Chunk>;
1090 getAllInitialChunks(): Set<Chunk>;
1091 getAllReferencedChunks(): Set<Chunk>;
1092 getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
1093 hasAsyncChunks(): boolean;
1094 getChildIdsByOrders(
1095 chunkGraph: ChunkGraph,
1096 filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1097 ): Record<string, (string | number)[]>;
1098 getChildrenOfTypeInOrder(
1099 chunkGraph: ChunkGraph,
1100 type: string
1101 ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
1102 getChildIdsByOrdersMap(
1103 chunkGraph: ChunkGraph,
1104 includeDirectChildren?: boolean,
1105 filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1106 ): Record<string | number, Record<string, (string | number)[]>>;
1107}
1108declare class ChunkGraph {
1109 constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
1110 moduleGraph: ModuleGraph;
1111 connectChunkAndModule(chunk: Chunk, module: Module): void;
1112 disconnectChunkAndModule(chunk: Chunk, module: Module): void;
1113 disconnectChunk(chunk: Chunk): void;
1114 attachModules(chunk: Chunk, modules: Iterable<Module>): void;
1115 attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
1116 attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
1117 attachDependentHashModules(
1118 chunk: Chunk,
1119 modules: Iterable<RuntimeModule>
1120 ): void;
1121 replaceModule(oldModule: Module, newModule: Module): void;
1122 isModuleInChunk(module: Module, chunk: Chunk): boolean;
1123 isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
1124 isEntryModule(module: Module): boolean;
1125 getModuleChunksIterable(module: Module): Iterable<Chunk>;
1126 getOrderedModuleChunksIterable(
1127 module: Module,
1128 sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
1129 ): Iterable<Chunk>;
1130 getModuleChunks(module: Module): Chunk[];
1131 getNumberOfModuleChunks(module: Module): number;
1132 getModuleRuntimes(module: Module): RuntimeSpecSet;
1133 getNumberOfChunkModules(chunk: Chunk): number;
1134 getNumberOfChunkFullHashModules(chunk: Chunk): number;
1135 getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
1136 getChunkModulesIterableBySourceType(
1137 chunk: Chunk,
1138 sourceType: string
1139 ): undefined | Iterable<Module>;
1140 setChunkModuleSourceTypes(
1141 chunk: Chunk,
1142 module: Module,
1143 sourceTypes: Set<string>
1144 ): void;
1145 getChunkModuleSourceTypes(chunk: Chunk, module: Module): Set<string>;
1146 getModuleSourceTypes(module: Module): Set<string>;
1147 getOrderedChunkModulesIterable(
1148 chunk: Chunk,
1149 comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
1150 ): Iterable<Module>;
1151 getOrderedChunkModulesIterableBySourceType(
1152 chunk: Chunk,
1153 sourceType: string,
1154 comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
1155 ): undefined | Iterable<Module>;
1156 getChunkModules(chunk: Chunk): Module[];
1157 getOrderedChunkModules(
1158 chunk: Chunk,
1159 comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
1160 ): Module[];
1161 getChunkModuleIdMap(
1162 chunk: Chunk,
1163 filterFn: (m: Module) => boolean,
1164 includeAllChunks?: boolean
1165 ): Record<string | number, (string | number)[]>;
1166 getChunkModuleRenderedHashMap(
1167 chunk: Chunk,
1168 filterFn: (m: Module) => boolean,
1169 hashLength?: number,
1170 includeAllChunks?: boolean
1171 ): Record<string | number, Record<string | number, string>>;
1172 getChunkConditionMap(
1173 chunk: Chunk,
1174 filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1175 ): Record<string | number, boolean>;
1176 hasModuleInGraph(
1177 chunk: Chunk,
1178 filterFn: (m: Module) => boolean,
1179 filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
1180 ): boolean;
1181 compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
1182 getChunkModulesSize(chunk: Chunk): number;
1183 getChunkModulesSizes(chunk: Chunk): Record<string, number>;
1184 getChunkRootModules(chunk: Chunk): Module[];
1185 getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
1186 getIntegratedChunksSize(
1187 chunkA: Chunk,
1188 chunkB: Chunk,
1189 options?: ChunkSizeOptions
1190 ): number;
1191 canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
1192 integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
1193 upgradeDependentToFullHashModules(chunk: Chunk): void;
1194 isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
1195 connectChunkAndEntryModule(
1196 chunk: Chunk,
1197 module: Module,
1198 entrypoint: Entrypoint
1199 ): void;
1200 connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
1201 addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
1202 addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
1203 disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
1204 disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
1205 disconnectEntryModule(module: Module): void;
1206 disconnectEntries(chunk: Chunk): void;
1207 getNumberOfEntryModules(chunk: Chunk): number;
1208 getNumberOfRuntimeModules(chunk: Chunk): number;
1209 getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
1210 getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
1211 hasChunkEntryDependentChunks(chunk: Chunk): boolean;
1212 getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
1213 getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
1214 getChunkFullHashModulesIterable(
1215 chunk: Chunk
1216 ): undefined | Iterable<RuntimeModule>;
1217 getChunkFullHashModulesSet(
1218 chunk: Chunk
1219 ): undefined | ReadonlySet<RuntimeModule>;
1220 getChunkDependentHashModulesIterable(
1221 chunk: Chunk
1222 ): undefined | Iterable<RuntimeModule>;
1223 getChunkEntryModulesWithChunkGroupIterable(
1224 chunk: Chunk
1225 ): Iterable<[Module, undefined | Entrypoint]>;
1226 getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
1227 connectBlockAndChunkGroup(
1228 depBlock: AsyncDependenciesBlock,
1229 chunkGroup: ChunkGroup
1230 ): void;
1231 disconnectChunkGroup(chunkGroup: ChunkGroup): void;
1232 getModuleId(module: Module): null | string | number;
1233 setModuleId(module: Module, id: ModuleId): void;
1234 getRuntimeId(runtime: string): string | number;
1235 setRuntimeId(runtime: string, id: string | number): void;
1236 hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
1237 getModuleHash(module: Module, runtime: RuntimeSpec): string;
1238 getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
1239 setModuleHashes(
1240 module: Module,
1241 runtime: RuntimeSpec,
1242 hash: string,
1243 renderedHash: string
1244 ): void;
1245 addModuleRuntimeRequirements(
1246 module: Module,
1247 runtime: RuntimeSpec,
1248 items: Set<string>,
1249 transferOwnership?: boolean
1250 ): void;
1251 addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
1252 addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
1253 getModuleRuntimeRequirements(
1254 module: Module,
1255 runtime: RuntimeSpec
1256 ): ReadonlySet<string>;
1257 getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
1258 getModuleGraphHash(
1259 module: Module,
1260 runtime: RuntimeSpec,
1261 withConnections?: boolean
1262 ): string;
1263 getModuleGraphHashBigInt(
1264 module: Module,
1265 runtime: RuntimeSpec,
1266 withConnections?: boolean
1267 ): bigint;
1268 getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
1269 static getChunkGraphForModule(
1270 module: Module,
1271 deprecateMessage: string,
1272 deprecationCode: string
1273 ): ChunkGraph;
1274 static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
1275 static clearChunkGraphForModule(module: Module): void;
1276 static getChunkGraphForChunk(
1277 chunk: Chunk,
1278 deprecateMessage: string,
1279 deprecationCode: string
1280 ): ChunkGraph;
1281 static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
1282 static clearChunkGraphForChunk(chunk: Chunk): void;
1283}
1284declare abstract class ChunkGroup {
1285 groupDebugId: number;
1286 options: ChunkGroupOptions;
1287 chunks: Chunk[];
1288 origins: OriginRecord[];
1289 index?: number;
1290
1291 /**
1292 * when a new chunk is added to a chunkGroup, addingOptions will occur.
1293 */
1294 addOptions(options: ChunkGroupOptions): void;
1295
1296 /**
1297 * returns the name of current ChunkGroup
1298 * sets a new name for current ChunkGroup
1299 */
1300 name?: string;
1301
1302 /**
1303 * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
1304 */
1305 get debugId(): string;
1306
1307 /**
1308 * get a unique id for ChunkGroup, made up of its member Chunk id's
1309 */
1310 get id(): string;
1311
1312 /**
1313 * Performs an unshift of a specific chunk
1314 */
1315 unshiftChunk(chunk: Chunk): boolean;
1316
1317 /**
1318 * inserts a chunk before another existing chunk in group
1319 */
1320 insertChunk(chunk: Chunk, before: Chunk): boolean;
1321
1322 /**
1323 * add a chunk into ChunkGroup. Is pushed on or prepended
1324 */
1325 pushChunk(chunk: Chunk): boolean;
1326 replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
1327 removeChunk(chunk: Chunk): boolean;
1328 isInitial(): boolean;
1329 addChild(group: ChunkGroup): boolean;
1330 getChildren(): ChunkGroup[];
1331 getNumberOfChildren(): number;
1332 get childrenIterable(): SortableSet<ChunkGroup>;
1333 removeChild(group: ChunkGroup): boolean;
1334 addParent(parentChunk: ChunkGroup): boolean;
1335 getParents(): ChunkGroup[];
1336 getNumberOfParents(): number;
1337 hasParent(parent: ChunkGroup): boolean;
1338 get parentsIterable(): SortableSet<ChunkGroup>;
1339 removeParent(chunkGroup: ChunkGroup): boolean;
1340 addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
1341 get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
1342 getBlocks(): AsyncDependenciesBlock[];
1343 getNumberOfBlocks(): number;
1344 hasBlock(block: AsyncDependenciesBlock): boolean;
1345 get blocksIterable(): Iterable<AsyncDependenciesBlock>;
1346 addBlock(block: AsyncDependenciesBlock): boolean;
1347 addOrigin(
1348 module: null | Module,
1349 loc: DependencyLocation,
1350 request: string
1351 ): void;
1352 getFiles(): string[];
1353 remove(): void;
1354 sortItems(): void;
1355
1356 /**
1357 * Sorting predicate which allows current ChunkGroup to be compared against another.
1358 * Sorting values are based off of number of chunks in ChunkGroup.
1359 */
1360 compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
1361 getChildrenByOrders(
1362 moduleGraph: ModuleGraph,
1363 chunkGraph: ChunkGraph
1364 ): Record<string, ChunkGroup[]>;
1365
1366 /**
1367 * Sets the top-down index of a module in this ChunkGroup
1368 */
1369 setModulePreOrderIndex(module: Module, index: number): void;
1370
1371 /**
1372 * Gets the top-down index of a module in this ChunkGroup
1373 */
1374 getModulePreOrderIndex(module: Module): undefined | number;
1375
1376 /**
1377 * Sets the bottom-up index of a module in this ChunkGroup
1378 */
1379 setModulePostOrderIndex(module: Module, index: number): void;
1380
1381 /**
1382 * Gets the bottom-up index of a module in this ChunkGroup
1383 */
1384 getModulePostOrderIndex(module: Module): undefined | number;
1385 checkConstraints(): void;
1386 getModuleIndex: (module: Module) => undefined | number;
1387 getModuleIndex2: (module: Module) => undefined | number;
1388}
1389type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
1390declare interface ChunkHashContext {
1391 /**
1392 * results of code generation
1393 */
1394 codeGenerationResults: CodeGenerationResults;
1395
1396 /**
1397 * the runtime template
1398 */
1399 runtimeTemplate: RuntimeTemplate;
1400
1401 /**
1402 * the module graph
1403 */
1404 moduleGraph: ModuleGraph;
1405
1406 /**
1407 * the chunk graph
1408 */
1409 chunkGraph: ChunkGraph;
1410}
1411type ChunkId = string | number;
1412declare interface ChunkMaps {
1413 hash: Record<string | number, string>;
1414 contentHash: Record<string | number, Record<string, string>>;
1415 name: Record<string | number, string>;
1416}
1417declare class ChunkModuleIdRangePlugin {
1418 constructor(options: ChunkModuleIdRangePluginOptions);
1419 options: ChunkModuleIdRangePluginOptions;
1420
1421 /**
1422 * Apply the plugin
1423 */
1424 apply(compiler: Compiler): void;
1425}
1426declare interface ChunkModuleIdRangePluginOptions {
1427 /**
1428 * the chunk name
1429 */
1430 name: string;
1431
1432 /**
1433 * order
1434 */
1435 order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
1436
1437 /**
1438 * start id
1439 */
1440 start?: number;
1441
1442 /**
1443 * end id
1444 */
1445 end?: number;
1446}
1447declare interface ChunkModuleMaps {
1448 id: Record<string | number, (string | number)[]>;
1449 hash: Record<string | number, string>;
1450}
1451declare interface ChunkPathData {
1452 id: string | number;
1453 name?: string;
1454 hash: string;
1455 hashWithLength?: (arg0: number) => string;
1456 contentHash?: Record<string, string>;
1457 contentHashWithLength?: Record<string, (length: number) => string>;
1458}
1459declare class ChunkPrefetchPreloadPlugin {
1460 constructor();
1461 apply(compiler: Compiler): void;
1462}
1463declare interface ChunkRenderContext {
1464 /**
1465 * the chunk
1466 */
1467 chunk: Chunk;
1468
1469 /**
1470 * the dependency templates
1471 */
1472 dependencyTemplates: DependencyTemplates;
1473
1474 /**
1475 * the runtime template
1476 */
1477 runtimeTemplate: RuntimeTemplate;
1478
1479 /**
1480 * the module graph
1481 */
1482 moduleGraph: ModuleGraph;
1483
1484 /**
1485 * the chunk graph
1486 */
1487 chunkGraph: ChunkGraph;
1488
1489 /**
1490 * results of code generation
1491 */
1492 codeGenerationResults: CodeGenerationResults;
1493
1494 /**
1495 * init fragments for the chunk
1496 */
1497 chunkInitFragments: InitFragment<ChunkRenderContext>[];
1498
1499 /**
1500 * rendering in strict context
1501 */
1502 strictMode?: boolean;
1503}
1504declare interface ChunkSizeOptions {
1505 /**
1506 * constant overhead for a chunk
1507 */
1508 chunkOverhead?: number;
1509
1510 /**
1511 * multiplicator for initial chunks
1512 */
1513 entryChunkMultiplicator?: number;
1514}
1515declare abstract class ChunkTemplate {
1516 hooks: Readonly<{
1517 renderManifest: {
1518 tap: <AdditionalOptions>(
1519 options:
1520 | string
1521 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1522 fn: (
1523 arg0: RenderManifestEntry[],
1524 arg1: RenderManifestOptions
1525 ) => RenderManifestEntry[]
1526 ) => void;
1527 };
1528 modules: {
1529 tap: <AdditionalOptions>(
1530 options:
1531 | string
1532 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1533 fn: (arg0: Source, arg1: ModuleTemplate, arg2: RenderContext) => Source
1534 ) => void;
1535 };
1536 render: {
1537 tap: <AdditionalOptions>(
1538 options:
1539 | string
1540 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1541 fn: (arg0: Source, arg1: ModuleTemplate, arg2: RenderContext) => Source
1542 ) => void;
1543 };
1544 renderWithEntry: {
1545 tap: <AdditionalOptions>(
1546 options:
1547 | string
1548 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1549 fn: (arg0: Source, arg1: Chunk) => Source
1550 ) => void;
1551 };
1552 hash: {
1553 tap: <AdditionalOptions>(
1554 options:
1555 | string
1556 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1557 fn: (arg0: Hash) => void
1558 ) => void;
1559 };
1560 hashForChunk: {
1561 tap: <AdditionalOptions>(
1562 options:
1563 | string
1564 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
1565 fn: (arg0: Hash, arg1: Chunk, arg2: ChunkHashContext) => void
1566 ) => void;
1567 };
1568 }>;
1569 get outputOptions(): Output;
1570}
1571
1572/**
1573 * Advanced options for cleaning assets.
1574 */
1575declare interface CleanOptions {
1576 /**
1577 * Log the assets that should be removed instead of deleting them.
1578 */
1579 dry?: boolean;
1580
1581 /**
1582 * Keep these assets.
1583 */
1584 keep?: string | RegExp | ((filename: string) => boolean);
1585}
1586declare class CleanPlugin {
1587 constructor(options?: CleanOptions);
1588 options: {
1589 /**
1590 * Log the assets that should be removed instead of deleting them.
1591 */
1592 dry: boolean;
1593 /**
1594 * Keep these assets.
1595 */
1596 keep?: string | RegExp | ((filename: string) => boolean);
1597 };
1598
1599 /**
1600 * Apply the plugin
1601 */
1602 apply(compiler: Compiler): void;
1603 static getCompilationHooks(
1604 compilation: Compilation
1605 ): CleanPluginCompilationHooks;
1606}
1607declare interface CleanPluginCompilationHooks {
1608 /**
1609 * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
1610 */
1611 keep: SyncBailHook<[string], boolean>;
1612}
1613declare interface CodeGenerationContext {
1614 /**
1615 * the dependency templates
1616 */
1617 dependencyTemplates: DependencyTemplates;
1618
1619 /**
1620 * the runtime template
1621 */
1622 runtimeTemplate: RuntimeTemplate;
1623
1624 /**
1625 * the module graph
1626 */
1627 moduleGraph: ModuleGraph;
1628
1629 /**
1630 * the chunk graph
1631 */
1632 chunkGraph: ChunkGraph;
1633
1634 /**
1635 * the runtimes code should be generated for
1636 */
1637 runtime: RuntimeSpec;
1638
1639 /**
1640 * when in concatenated module, information about other concatenated modules
1641 */
1642 concatenationScope?: ConcatenationScope;
1643
1644 /**
1645 * code generation results of other modules (need to have a codeGenerationDependency to use that)
1646 */
1647 codeGenerationResults?: CodeGenerationResults;
1648
1649 /**
1650 * the compilation
1651 */
1652 compilation?: Compilation;
1653
1654 /**
1655 * source types
1656 */
1657 sourceTypes?: ReadonlySet<string>;
1658}
1659declare interface CodeGenerationResult {
1660 /**
1661 * the resulting sources for all source types
1662 */
1663 sources: Map<string, Source>;
1664
1665 /**
1666 * the resulting data for all source types
1667 */
1668 data?: Map<string, any>;
1669
1670 /**
1671 * the runtime requirements
1672 */
1673 runtimeRequirements: null | ReadonlySet<string>;
1674
1675 /**
1676 * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
1677 */
1678 hash?: string;
1679}
1680declare abstract class CodeGenerationResults {
1681 map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
1682 get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
1683 has(module: Module, runtime: RuntimeSpec): boolean;
1684 getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
1685 getRuntimeRequirements(
1686 module: Module,
1687 runtime: RuntimeSpec
1688 ): ReadonlySet<string>;
1689 getData(module: Module, runtime: RuntimeSpec, key: string): any;
1690 getHash(module: Module, runtime: RuntimeSpec): any;
1691 add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
1692}
1693type CodeValue =
1694 | undefined
1695 | null
1696 | string
1697 | number
1698 | bigint
1699 | boolean
1700 | Function
1701 | RegExp
1702 | RuntimeValue
1703 | {
1704 [index: string]: RecursiveArrayOrRecord<
1705 | undefined
1706 | null
1707 | string
1708 | number
1709 | bigint
1710 | boolean
1711 | Function
1712 | RegExp
1713 | RuntimeValue
1714 >;
1715 }
1716 | RecursiveArrayOrRecord<
1717 | undefined
1718 | null
1719 | string
1720 | number
1721 | bigint
1722 | boolean
1723 | Function
1724 | RegExp
1725 | RuntimeValue
1726 >[];
1727type CodeValuePrimitive =
1728 | undefined
1729 | null
1730 | string
1731 | number
1732 | bigint
1733 | boolean
1734 | Function
1735 | RegExp;
1736declare interface Comparator<T> {
1737 (arg0: T, arg1: T): 0 | 1 | -1;
1738}
1739declare class CompatSource extends Source {
1740 constructor(sourceLike: SourceLike);
1741 static from(sourceLike: SourceLike): Source;
1742}
1743declare class Compilation {
1744 /**
1745 * Creates an instance of Compilation.
1746 */
1747 constructor(compiler: Compiler, params: CompilationParams);
1748 hooks: Readonly<{
1749 buildModule: SyncHook<[Module]>;
1750 rebuildModule: SyncHook<[Module]>;
1751 failedModule: SyncHook<[Module, WebpackError]>;
1752 succeedModule: SyncHook<[Module]>;
1753 stillValidModule: SyncHook<[Module]>;
1754 addEntry: SyncHook<[Dependency, EntryOptions]>;
1755 failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
1756 succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
1757 dependencyReferencedExports: SyncWaterfallHook<
1758 [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
1759 >;
1760 executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
1761 prepareModuleExecution: AsyncParallelHook<
1762 [ExecuteModuleArgument, ExecuteModuleContext]
1763 >;
1764 finishModules: AsyncSeriesHook<[Iterable<Module>]>;
1765 finishRebuildingModule: AsyncSeriesHook<[Module]>;
1766 unseal: SyncHook<[]>;
1767 seal: SyncHook<[]>;
1768 beforeChunks: SyncHook<[]>;
1769 /**
1770 * The `afterChunks` hook is called directly after the chunks and module graph have
1771 * been created and before the chunks and modules have been optimized. This hook is useful to
1772 * inspect, analyze, and/or modify the chunk graph.
1773 */
1774 afterChunks: SyncHook<[Iterable<Chunk>]>;
1775 optimizeDependencies: SyncBailHook<[Iterable<Module>], boolean | void>;
1776 afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
1777 optimize: SyncHook<[]>;
1778 optimizeModules: SyncBailHook<[Iterable<Module>], boolean | void>;
1779 afterOptimizeModules: SyncHook<[Iterable<Module>]>;
1780 optimizeChunks: SyncBailHook<
1781 [Iterable<Chunk>, ChunkGroup[]],
1782 boolean | void
1783 >;
1784 afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
1785 optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
1786 afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
1787 optimizeChunkModules: AsyncSeriesBailHook<
1788 [Iterable<Chunk>, Iterable<Module>],
1789 void
1790 >;
1791 afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
1792 shouldRecord: SyncBailHook<[], undefined | boolean>;
1793 additionalChunkRuntimeRequirements: SyncHook<
1794 [Chunk, Set<string>, RuntimeRequirementsContext]
1795 >;
1796 runtimeRequirementInChunk: HookMap<
1797 SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
1798 >;
1799 additionalModuleRuntimeRequirements: SyncHook<
1800 [Module, Set<string>, RuntimeRequirementsContext]
1801 >;
1802 runtimeRequirementInModule: HookMap<
1803 SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], void>
1804 >;
1805 additionalTreeRuntimeRequirements: SyncHook<
1806 [Chunk, Set<string>, RuntimeRequirementsContext]
1807 >;
1808 runtimeRequirementInTree: HookMap<
1809 SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
1810 >;
1811 runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
1812 reviveModules: SyncHook<[Iterable<Module>, any]>;
1813 beforeModuleIds: SyncHook<[Iterable<Module>]>;
1814 moduleIds: SyncHook<[Iterable<Module>]>;
1815 optimizeModuleIds: SyncHook<[Iterable<Module>]>;
1816 afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
1817 reviveChunks: SyncHook<[Iterable<Chunk>, any]>;
1818 beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
1819 chunkIds: SyncHook<[Iterable<Chunk>]>;
1820 optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
1821 afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
1822 recordModules: SyncHook<[Iterable<Module>, any]>;
1823 recordChunks: SyncHook<[Iterable<Chunk>, any]>;
1824 optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
1825 beforeModuleHash: SyncHook<[]>;
1826 afterModuleHash: SyncHook<[]>;
1827 beforeCodeGeneration: SyncHook<[]>;
1828 afterCodeGeneration: SyncHook<[]>;
1829 beforeRuntimeRequirements: SyncHook<[]>;
1830 afterRuntimeRequirements: SyncHook<[]>;
1831 beforeHash: SyncHook<[]>;
1832 contentHash: SyncHook<[Chunk]>;
1833 afterHash: SyncHook<[]>;
1834 recordHash: SyncHook<[any]>;
1835 record: SyncHook<[Compilation, any]>;
1836 beforeModuleAssets: SyncHook<[]>;
1837 shouldGenerateChunkAssets: SyncBailHook<[], boolean>;
1838 beforeChunkAssets: SyncHook<[]>;
1839 additionalChunkAssets: FakeHook<
1840 Pick<
1841 AsyncSeriesHook<[Set<Chunk>]>,
1842 "name" | "tap" | "tapAsync" | "tapPromise"
1843 >
1844 >;
1845 additionalAssets: FakeHook<
1846 Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
1847 >;
1848 optimizeChunkAssets: FakeHook<
1849 Pick<
1850 AsyncSeriesHook<[Set<Chunk>]>,
1851 "name" | "tap" | "tapAsync" | "tapPromise"
1852 >
1853 >;
1854 afterOptimizeChunkAssets: FakeHook<
1855 Pick<
1856 AsyncSeriesHook<[Set<Chunk>]>,
1857 "name" | "tap" | "tapAsync" | "tapPromise"
1858 >
1859 >;
1860 optimizeAssets: AsyncSeriesHook<
1861 [CompilationAssets],
1862 ProcessAssetsAdditionalOptions
1863 >;
1864 afterOptimizeAssets: SyncHook<[CompilationAssets]>;
1865 processAssets: AsyncSeriesHook<
1866 [CompilationAssets],
1867 ProcessAssetsAdditionalOptions
1868 >;
1869 afterProcessAssets: SyncHook<[CompilationAssets]>;
1870 processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
1871 needAdditionalSeal: SyncBailHook<[], undefined | boolean>;
1872 afterSeal: AsyncSeriesHook<[]>;
1873 renderManifest: SyncWaterfallHook<
1874 [RenderManifestEntry[], RenderManifestOptions]
1875 >;
1876 fullHash: SyncHook<[Hash]>;
1877 chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
1878 moduleAsset: SyncHook<[Module, string]>;
1879 chunkAsset: SyncHook<[Chunk, string]>;
1880 assetPath: SyncWaterfallHook<[string, object, undefined | AssetInfo]>;
1881 needAdditionalPass: SyncBailHook<[], boolean>;
1882 childCompiler: SyncHook<[Compiler, string, number]>;
1883 log: SyncBailHook<[string, LogEntry], true>;
1884 processWarnings: SyncWaterfallHook<[WebpackError[]]>;
1885 processErrors: SyncWaterfallHook<[WebpackError[]]>;
1886 statsPreset: HookMap<
1887 SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
1888 >;
1889 statsNormalize: SyncHook<
1890 [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
1891 >;
1892 statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
1893 statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
1894 get normalModuleLoader(): SyncHook<
1895 [LoaderContextNormalModule<any>, NormalModule]
1896 >;
1897 }>;
1898 name?: string;
1899 startTime?: number;
1900 endTime?: number;
1901 compiler: Compiler;
1902 resolverFactory: ResolverFactory;
1903 inputFileSystem: InputFileSystem;
1904 fileSystemInfo: FileSystemInfo;
1905 valueCacheVersions: Map<string, ValueCacheVersion>;
1906 requestShortener: RequestShortener;
1907 compilerPath: string;
1908 logger: WebpackLogger;
1909 options: WebpackOptionsNormalized;
1910 outputOptions: OutputNormalized;
1911 bail: boolean;
1912 profile: boolean;
1913 params: CompilationParams;
1914 mainTemplate: MainTemplate;
1915 chunkTemplate: ChunkTemplate;
1916 runtimeTemplate: RuntimeTemplate;
1917 moduleTemplates: ModuleTemplates;
1918 moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
1919 moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
1920 moduleGraph: ModuleGraph;
1921 chunkGraph: ChunkGraph;
1922 codeGenerationResults: CodeGenerationResults;
1923 processDependenciesQueue: AsyncQueue<Module, Module, Module>;
1924 addModuleQueue: AsyncQueue<Module, string, Module>;
1925 factorizeQueue: AsyncQueue<
1926 FactorizeModuleOptions,
1927 string,
1928 Module | ModuleFactoryResult
1929 >;
1930 buildQueue: AsyncQueue<Module, Module, Module>;
1931 rebuildQueue: AsyncQueue<Module, Module, Module>;
1932
1933 /**
1934 * Modules in value are building during the build of Module in key.
1935 * Means value blocking key from finishing.
1936 * Needed to detect build cycles.
1937 */
1938 creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
1939 entries: Map<string, EntryData>;
1940 globalEntry: EntryData;
1941 entrypoints: Map<string, Entrypoint>;
1942 asyncEntrypoints: Entrypoint[];
1943 chunks: Set<Chunk>;
1944 chunkGroups: ChunkGroup[];
1945 namedChunkGroups: Map<string, ChunkGroup>;
1946 namedChunks: Map<string, Chunk>;
1947 modules: Set<Module>;
1948 records: any;
1949 additionalChunkAssets: string[];
1950 assets: CompilationAssets;
1951 assetsInfo: Map<string, AssetInfo>;
1952 errors: WebpackError[];
1953 warnings: WebpackError[];
1954 children: Compilation[];
1955 logging: Map<string, LogEntry[]>;
1956 dependencyFactories: Map<DepConstructor, ModuleFactory>;
1957 dependencyTemplates: DependencyTemplates;
1958 childrenCounters: Record<string, number>;
1959 usedChunkIds: Set<string | number>;
1960 usedModuleIds: Set<number>;
1961 needAdditionalPass: boolean;
1962 builtModules: WeakSet<Module>;
1963 codeGeneratedModules: WeakSet<Module>;
1964 buildTimeExecutedModules: WeakSet<Module>;
1965 emittedAssets: Set<string>;
1966 comparedForEmitAssets: Set<string>;
1967 fileDependencies: LazySet<string>;
1968 contextDependencies: LazySet<string>;
1969 missingDependencies: LazySet<string>;
1970 buildDependencies: LazySet<string>;
1971 compilationDependencies: { add: (item: string) => LazySet<string> };
1972 getStats(): Stats;
1973 createStatsOptions(
1974 optionsOrPreset?: string | boolean | StatsOptions,
1975 context?: CreateStatsOptionsContext
1976 ): NormalizedStatsOptions;
1977 createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
1978 createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
1979 getCache(name: string): CacheFacade;
1980 getLogger(name: string | (() => string)): WebpackLogger;
1981 addModule(
1982 module: Module,
1983 callback: (err?: null | WebpackError, result?: null | Module) => void
1984 ): void;
1985
1986 /**
1987 * Fetches a module from a compilation by its identifier
1988 */
1989 getModule(module: Module): Module;
1990
1991 /**
1992 * Attempts to search for a module by its identifier
1993 */
1994 findModule(identifier: string): undefined | Module;
1995
1996 /**
1997 * Schedules a build of the module object
1998 */
1999 buildModule(
2000 module: Module,
2001 callback: (err?: null | WebpackError, result?: null | Module) => void
2002 ): void;
2003 processModuleDependencies(
2004 module: Module,
2005 callback: (err?: null | WebpackError, result?: null | Module) => void
2006 ): void;
2007 processModuleDependenciesNonRecursive(module: Module): void;
2008 handleModuleCreation(
2009 __0: HandleModuleCreationOptions,
2010 callback: (err?: null | WebpackError, result?: null | Module) => void
2011 ): void;
2012 addModuleChain(
2013 context: string,
2014 dependency: Dependency,
2015 callback: (err?: null | WebpackError, result?: null | Module) => void
2016 ): void;
2017 addModuleTree(
2018 __0: {
2019 /**
2020 * context string path
2021 */
2022 context: string;
2023 /**
2024 * dependency used to create Module chain
2025 */
2026 dependency: Dependency;
2027 /**
2028 * additional context info for the root module
2029 */
2030 contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
2031 },
2032 callback: (err?: null | WebpackError, result?: null | Module) => void
2033 ): void;
2034 addEntry(
2035 context: string,
2036 entry: Dependency,
2037 optionsOrName: string | EntryOptions,
2038 callback: (err?: null | WebpackError, result?: null | Module) => void
2039 ): void;
2040 addInclude(
2041 context: string,
2042 dependency: Dependency,
2043 options: EntryOptions,
2044 callback: (err?: null | WebpackError, result?: null | Module) => void
2045 ): void;
2046 rebuildModule(
2047 module: Module,
2048 callback: (err?: null | WebpackError, result?: null | Module) => void
2049 ): void;
2050 finish(callback: (err?: null | WebpackError) => void): void;
2051 unseal(): void;
2052 seal(callback: (err?: null | WebpackError) => void): void;
2053 reportDependencyErrorsAndWarnings(
2054 module: Module,
2055 blocks: DependenciesBlock[]
2056 ): boolean;
2057 codeGeneration(callback: (err?: null | WebpackError) => void): void;
2058 processRuntimeRequirements(__0?: {
2059 /**
2060 * the chunk graph
2061 */
2062 chunkGraph?: ChunkGraph;
2063 /**
2064 * modules
2065 */
2066 modules?: Iterable<Module>;
2067 /**
2068 * chunks
2069 */
2070 chunks?: Iterable<Chunk>;
2071 /**
2072 * codeGenerationResults
2073 */
2074 codeGenerationResults?: CodeGenerationResults;
2075 /**
2076 * chunkGraphEntries
2077 */
2078 chunkGraphEntries?: Iterable<Chunk>;
2079 }): void;
2080 addRuntimeModule(
2081 chunk: Chunk,
2082 module: RuntimeModule,
2083 chunkGraph?: ChunkGraph
2084 ): void;
2085
2086 /**
2087 * If `module` is passed, `loc` and `request` must also be passed.
2088 */
2089 addChunkInGroup(
2090 groupOptions: string | ChunkGroupOptions,
2091 module?: Module,
2092 loc?: SyntheticDependencyLocation | RealDependencyLocation,
2093 request?: string
2094 ): ChunkGroup;
2095 addAsyncEntrypoint(
2096 options: EntryOptions,
2097 module: Module,
2098 loc: DependencyLocation,
2099 request: string
2100 ): Entrypoint;
2101
2102 /**
2103 * This method first looks to see if a name is provided for a new chunk,
2104 * and first looks to see if any named chunks already exist and reuse that chunk instead.
2105 */
2106 addChunk(name?: string): Chunk;
2107 assignDepth(module: Module): void;
2108 assignDepths(modules: Set<Module>): void;
2109 getDependencyReferencedExports(
2110 dependency: Dependency,
2111 runtime: RuntimeSpec
2112 ): (string[] | ReferencedExport)[];
2113 removeReasonsOfDependencyBlock(
2114 module: Module,
2115 block: DependenciesBlockLike
2116 ): void;
2117 patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
2118 removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
2119 assignRuntimeIds(): void;
2120 sortItemsWithChunkIds(): void;
2121 summarizeDependencies(): void;
2122 createModuleHashes(): void;
2123 createHash(): {
2124 module: Module;
2125 hash: string;
2126 runtime: RuntimeSpec;
2127 runtimes: RuntimeSpec[];
2128 }[];
2129 fullHash?: string;
2130 hash?: string;
2131 emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
2132 updateAsset(
2133 file: string,
2134 newSourceOrFunction: Source | ((arg0: Source) => Source),
2135 assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
2136 ): void;
2137 renameAsset(file: string, newFile: string): void;
2138 deleteAsset(file: string): void;
2139 getAssets(): Readonly<Asset>[];
2140 getAsset(name: string): undefined | Readonly<Asset>;
2141 clearAssets(): void;
2142 createModuleAssets(): void;
2143 getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
2144 createChunkAssets(callback: (err?: null | WebpackError) => void): void;
2145 getPath(filename: TemplatePath, data?: PathData): string;
2146 getPathWithInfo(
2147 filename: TemplatePath,
2148 data?: PathData
2149 ): InterpolatedPathAndAssetInfo;
2150 getAssetPath(filename: TemplatePath, data: PathData): string;
2151 getAssetPathWithInfo(
2152 filename: TemplatePath,
2153 data: PathData
2154 ): InterpolatedPathAndAssetInfo;
2155 getWarnings(): WebpackError[];
2156 getErrors(): WebpackError[];
2157
2158 /**
2159 * This function allows you to run another instance of webpack inside of webpack however as
2160 * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
2161 * from parent (or top level compiler) and creates a child Compilation
2162 */
2163 createChildCompiler(
2164 name: string,
2165 outputOptions?: OutputNormalized,
2166 plugins?: (
2167 | ((this: Compiler, compiler: Compiler) => void)
2168 | WebpackPluginInstance
2169 )[]
2170 ): Compiler;
2171 executeModule(
2172 module: Module,
2173 options: ExecuteModuleOptions,
2174 callback: (err: null | WebpackError, result?: ExecuteModuleResult) => void
2175 ): void;
2176 checkConstraints(): void;
2177 factorizeModule: {
2178 (
2179 options: FactorizeModuleOptions & { factoryResult?: false },
2180 callback: (err?: null | WebpackError, result?: null | Module) => void
2181 ): void;
2182 (
2183 options: FactorizeModuleOptions & { factoryResult: true },
2184 callback: (
2185 err?: null | WebpackError,
2186 result?: ModuleFactoryResult
2187 ) => void
2188 ): void;
2189 };
2190
2191 /**
2192 * Add additional assets to the compilation.
2193 */
2194 static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
2195
2196 /**
2197 * Basic preprocessing of assets.
2198 */
2199 static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
2200
2201 /**
2202 * Derive new assets from existing assets.
2203 * Existing assets should not be treated as complete.
2204 */
2205 static PROCESS_ASSETS_STAGE_DERIVED: number;
2206
2207 /**
2208 * Add additional sections to existing assets, like a banner or initialization code.
2209 */
2210 static PROCESS_ASSETS_STAGE_ADDITIONS: number;
2211
2212 /**
2213 * Optimize existing assets in a general way.
2214 */
2215 static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
2216
2217 /**
2218 * Optimize the count of existing assets, e. g. by merging them.
2219 * Only assets of the same type should be merged.
2220 * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
2221 */
2222 static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
2223
2224 /**
2225 * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
2226 */
2227 static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
2228
2229 /**
2230 * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
2231 */
2232 static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
2233
2234 /**
2235 * Add development tooling to assets, e. g. by extracting a SourceMap.
2236 */
2237 static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
2238
2239 /**
2240 * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
2241 * Only assets of different types should be inlined.
2242 * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
2243 */
2244 static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
2245
2246 /**
2247 * Summarize the list of existing assets
2248 * e. g. creating an assets manifest of Service Workers.
2249 */
2250 static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
2251
2252 /**
2253 * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
2254 */
2255 static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
2256
2257 /**
2258 * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
2259 */
2260 static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
2261
2262 /**
2263 * Analyse existing assets.
2264 */
2265 static PROCESS_ASSETS_STAGE_ANALYSE: number;
2266
2267 /**
2268 * Creating assets for reporting purposes.
2269 */
2270 static PROCESS_ASSETS_STAGE_REPORT: number;
2271}
2272declare interface CompilationAssets {
2273 [index: string]: Source;
2274}
2275declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
2276 renderModuleContent: SyncWaterfallHook<
2277 [Source, Module, WebAssemblyRenderContext]
2278 >;
2279}
2280declare interface CompilationHooksJavascriptModulesPlugin {
2281 renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
2282 renderModuleContainer: SyncWaterfallHook<
2283 [Source, Module, ChunkRenderContext]
2284 >;
2285 renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
2286 renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
2287 renderMain: SyncWaterfallHook<[Source, RenderContext]>;
2288 renderContent: SyncWaterfallHook<[Source, RenderContext]>;
2289 render: SyncWaterfallHook<[Source, RenderContext]>;
2290 renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
2291 renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
2292 inlineInRuntimeBailout: SyncBailHook<
2293 [Module, RenderBootstrapContext],
2294 string
2295 >;
2296 embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string | void>;
2297 strictRuntimeBailout: SyncBailHook<[RenderContext], string | void>;
2298 chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
2299 useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
2300}
2301declare interface CompilationHooksRealContentHashPlugin {
2302 updateHash: SyncBailHook<[Buffer[], string], string>;
2303}
2304declare interface CompilationParams {
2305 normalModuleFactory: NormalModuleFactory;
2306 contextModuleFactory: ContextModuleFactory;
2307}
2308declare class Compiler {
2309 constructor(context: string, options?: WebpackOptionsNormalized);
2310 hooks: Readonly<{
2311 initialize: SyncHook<[]>;
2312 shouldEmit: SyncBailHook<[Compilation], undefined | boolean>;
2313 done: AsyncSeriesHook<[Stats]>;
2314 afterDone: SyncHook<[Stats]>;
2315 additionalPass: AsyncSeriesHook<[]>;
2316 beforeRun: AsyncSeriesHook<[Compiler]>;
2317 run: AsyncSeriesHook<[Compiler]>;
2318 emit: AsyncSeriesHook<[Compilation]>;
2319 assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
2320 afterEmit: AsyncSeriesHook<[Compilation]>;
2321 thisCompilation: SyncHook<[Compilation, CompilationParams]>;
2322 compilation: SyncHook<[Compilation, CompilationParams]>;
2323 normalModuleFactory: SyncHook<[NormalModuleFactory]>;
2324 contextModuleFactory: SyncHook<[ContextModuleFactory]>;
2325 beforeCompile: AsyncSeriesHook<[CompilationParams]>;
2326 compile: SyncHook<[CompilationParams]>;
2327 make: AsyncParallelHook<[Compilation]>;
2328 finishMake: AsyncParallelHook<[Compilation]>;
2329 afterCompile: AsyncSeriesHook<[Compilation]>;
2330 readRecords: AsyncSeriesHook<[]>;
2331 emitRecords: AsyncSeriesHook<[]>;
2332 watchRun: AsyncSeriesHook<[Compiler]>;
2333 failed: SyncHook<[Error]>;
2334 invalid: SyncHook<[null | string, number]>;
2335 watchClose: SyncHook<[]>;
2336 shutdown: AsyncSeriesHook<[]>;
2337 infrastructureLog: SyncBailHook<[string, string, undefined | any[]], true>;
2338 environment: SyncHook<[]>;
2339 afterEnvironment: SyncHook<[]>;
2340 afterPlugins: SyncHook<[Compiler]>;
2341 afterResolvers: SyncHook<[Compiler]>;
2342 entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
2343 }>;
2344 webpack: typeof exports;
2345 name?: string;
2346 parentCompilation?: Compilation;
2347 root: Compiler;
2348 outputPath: string;
2349 watching?: Watching;
2350 outputFileSystem: null | OutputFileSystem;
2351 intermediateFileSystem: null | IntermediateFileSystem;
2352 inputFileSystem: null | InputFileSystem;
2353 watchFileSystem: null | WatchFileSystem;
2354 recordsInputPath: null | string;
2355 recordsOutputPath: null | string;
2356 records: Record<string, any>;
2357 managedPaths: Set<string | RegExp>;
2358 unmanagedPaths: Set<string | RegExp>;
2359 immutablePaths: Set<string | RegExp>;
2360 modifiedFiles?: ReadonlySet<string>;
2361 removedFiles?: ReadonlySet<string>;
2362 fileTimestamps?: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
2363 contextTimestamps?: ReadonlyMap<
2364 string,
2365 null | FileSystemInfoEntry | "ignore"
2366 >;
2367 fsStartTime?: number;
2368 resolverFactory: ResolverFactory;
2369 infrastructureLogger?: (
2370 arg0: string,
2371 arg1: LogTypeEnum,
2372 arg2?: any[]
2373 ) => void;
2374 platform: Readonly<PlatformTargetProperties>;
2375 options: WebpackOptionsNormalized;
2376 context: string;
2377 requestShortener: RequestShortener;
2378 cache: Cache;
2379 moduleMemCaches?: Map<
2380 Module,
2381 {
2382 buildInfo: BuildInfo;
2383 references?: WeakMap<Dependency, Module>;
2384 memCache: WeakTupleMap<any, any>;
2385 }
2386 >;
2387 compilerPath: string;
2388 running: boolean;
2389 idle: boolean;
2390 watchMode: boolean;
2391 getCache(name: string): CacheFacade;
2392 getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
2393 watch(watchOptions: WatchOptions, handler: RunCallback<Stats>): Watching;
2394 run(callback: RunCallback<Stats>): void;
2395 runAsChild(
2396 callback: (
2397 err: null | Error,
2398 entries?: Chunk[],
2399 compilation?: Compilation
2400 ) => any
2401 ): void;
2402 purgeInputFileSystem(): void;
2403 emitAssets(
2404 compilation: Compilation,
2405 callback: CallbackFunction_2<void>
2406 ): void;
2407 emitRecords(callback: CallbackFunction_2<void>): void;
2408 readRecords(callback: CallbackFunction_2<void>): void;
2409 createChildCompiler(
2410 compilation: Compilation,
2411 compilerName: string,
2412 compilerIndex: number,
2413 outputOptions?: OutputNormalized,
2414 plugins?: WebpackPluginInstance[]
2415 ): Compiler;
2416 isChild(): boolean;
2417 createCompilation(params: CompilationParams): Compilation;
2418 newCompilation(params: CompilationParams): Compilation;
2419 createNormalModuleFactory(): NormalModuleFactory;
2420 createContextModuleFactory(): ContextModuleFactory;
2421 newCompilationParams(): {
2422 normalModuleFactory: NormalModuleFactory;
2423 contextModuleFactory: ContextModuleFactory;
2424 };
2425 compile(callback: RunCallback<Compilation>): void;
2426 close(callback: RunCallback<void>): void;
2427}
2428declare class ConcatSource extends Source {
2429 constructor(...args: (string | Source)[]);
2430 getChildren(): Source[];
2431 add(item: string | Source): void;
2432 addAllSkipOptimizing(items: Source[]): void;
2433}
2434declare interface ConcatenatedModuleInfo {
2435 index: number;
2436 module: Module;
2437
2438 /**
2439 * mapping from export name to symbol
2440 */
2441 exportMap: Map<string, string>;
2442
2443 /**
2444 * mapping from export name to symbol
2445 */
2446 rawExportMap: Map<string, string>;
2447 namespaceExportSymbol?: string;
2448}
2449declare interface ConcatenationBailoutReasonContext {
2450 /**
2451 * the module graph
2452 */
2453 moduleGraph: ModuleGraph;
2454
2455 /**
2456 * the chunk graph
2457 */
2458 chunkGraph: ChunkGraph;
2459}
2460declare class ConcatenationScope {
2461 constructor(
2462 modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
2463 currentModule: ConcatenatedModuleInfo
2464 );
2465 isModuleInScope(module: Module): boolean;
2466 registerExport(exportName: string, symbol: string): void;
2467 registerRawExport(exportName: string, expression: string): void;
2468 registerNamespaceExport(symbol: string): void;
2469 createModuleReference(
2470 module: Module,
2471 __1: Partial<ModuleReferenceOptions>
2472 ): string;
2473 static isModuleReference(name: string): boolean;
2474 static matchModuleReference(
2475 name: string
2476 ): null | (ModuleReferenceOptions & { index: number });
2477 static DEFAULT_EXPORT: string;
2478 static NAMESPACE_OBJECT_EXPORT: string;
2479}
2480
2481/**
2482 * Options object as provided by the user.
2483 */
2484declare interface Configuration {
2485 /**
2486 * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
2487 */
2488 amd?: false | { [index: string]: any };
2489
2490 /**
2491 * Report the first error as a hard error instead of tolerating it.
2492 */
2493 bail?: boolean;
2494
2495 /**
2496 * Cache generated modules and chunks to improve performance for multiple incremental builds.
2497 */
2498 cache?: boolean | FileCacheOptions | MemoryCacheOptions;
2499
2500 /**
2501 * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
2502 */
2503 context?: string;
2504
2505 /**
2506 * References to other configurations to depend on.
2507 */
2508 dependencies?: string[];
2509
2510 /**
2511 * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
2512 */
2513 devtool?: string | false;
2514
2515 /**
2516 * The entry point(s) of the compilation.
2517 */
2518 entry?:
2519 | string
2520 | (() => string | EntryObject | string[] | Promise<EntryStatic>)
2521 | EntryObject
2522 | string[];
2523
2524 /**
2525 * Enables/Disables experiments (experimental features with relax SemVer compatibility).
2526 */
2527 experiments?: Experiments;
2528
2529 /**
2530 * Extend configuration from another configuration (only works when using webpack-cli).
2531 */
2532 extends?: string | string[];
2533
2534 /**
2535 * 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`.
2536 */
2537 externals?:
2538 | string
2539 | RegExp
2540 | ExternalItem[]
2541 | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
2542 | ((
2543 data: ExternalItemFunctionData,
2544 callback: (
2545 err?: null | Error,
2546 result?: string | boolean | string[] | { [index: string]: any }
2547 ) => void
2548 ) => void)
2549 | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
2550
2551 /**
2552 * Enable presets of externals for specific targets.
2553 */
2554 externalsPresets?: ExternalsPresets;
2555
2556 /**
2557 * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
2558 */
2559 externalsType?:
2560 | "import"
2561 | "var"
2562 | "module"
2563 | "assign"
2564 | "this"
2565 | "window"
2566 | "self"
2567 | "global"
2568 | "commonjs"
2569 | "commonjs2"
2570 | "commonjs-module"
2571 | "commonjs-static"
2572 | "amd"
2573 | "amd-require"
2574 | "umd"
2575 | "umd2"
2576 | "jsonp"
2577 | "system"
2578 | "promise"
2579 | "module-import"
2580 | "script"
2581 | "node-commonjs";
2582
2583 /**
2584 * Ignore specific warnings.
2585 */
2586 ignoreWarnings?: (
2587 | RegExp
2588 | {
2589 /**
2590 * A RegExp to select the origin file for the warning.
2591 */
2592 file?: RegExp;
2593 /**
2594 * A RegExp to select the warning message.
2595 */
2596 message?: RegExp;
2597 /**
2598 * A RegExp to select the origin module for the warning.
2599 */
2600 module?: RegExp;
2601 }
2602 | ((warning: WebpackError, compilation: Compilation) => boolean)
2603 )[];
2604
2605 /**
2606 * Options for infrastructure level logging.
2607 */
2608 infrastructureLogging?: InfrastructureLogging;
2609
2610 /**
2611 * Custom values available in the loader context.
2612 */
2613 loader?: Loader;
2614
2615 /**
2616 * Enable production optimizations or development hints.
2617 */
2618 mode?: "none" | "development" | "production";
2619
2620 /**
2621 * Options affecting the normal modules (`NormalModuleFactory`).
2622 */
2623 module?: ModuleOptions;
2624
2625 /**
2626 * Name of the configuration. Used when loading multiple configurations.
2627 */
2628 name?: string;
2629
2630 /**
2631 * Include polyfills or mocks for various node stuff.
2632 */
2633 node?: false | NodeOptions;
2634
2635 /**
2636 * Enables/Disables integrated optimizations.
2637 */
2638 optimization?: Optimization;
2639
2640 /**
2641 * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
2642 */
2643 output?: Output;
2644
2645 /**
2646 * The number of parallel processed modules in the compilation.
2647 */
2648 parallelism?: number;
2649
2650 /**
2651 * Configuration for web performance recommendations.
2652 */
2653 performance?: false | PerformanceOptions;
2654
2655 /**
2656 * Add additional plugins to the compiler.
2657 */
2658 plugins?: (
2659 | undefined
2660 | null
2661 | false
2662 | ""
2663 | 0
2664 | ((this: Compiler, compiler: Compiler) => void)
2665 | WebpackPluginInstance
2666 )[];
2667
2668 /**
2669 * Capture timing information for each module.
2670 */
2671 profile?: boolean;
2672
2673 /**
2674 * Store compiler state to a json file.
2675 */
2676 recordsInputPath?: string | false;
2677
2678 /**
2679 * Load compiler state from a json file.
2680 */
2681 recordsOutputPath?: string | false;
2682
2683 /**
2684 * 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.
2685 */
2686 recordsPath?: string | false;
2687
2688 /**
2689 * Options for the resolver.
2690 */
2691 resolve?: ResolveOptions;
2692
2693 /**
2694 * Options for the resolver when resolving loaders.
2695 */
2696 resolveLoader?: ResolveOptions;
2697
2698 /**
2699 * Options affecting how file system snapshots are created and validated.
2700 */
2701 snapshot?: SnapshotOptionsWebpackOptions;
2702
2703 /**
2704 * Stats options object or preset name.
2705 */
2706 stats?:
2707 | boolean
2708 | StatsOptions
2709 | "none"
2710 | "verbose"
2711 | "summary"
2712 | "errors-only"
2713 | "errors-warnings"
2714 | "minimal"
2715 | "normal"
2716 | "detailed";
2717
2718 /**
2719 * Environment to build for. An array of environments to build for all of them when possible.
2720 */
2721 target?: string | false | string[];
2722
2723 /**
2724 * Enter watch mode, which rebuilds on file change.
2725 */
2726 watch?: boolean;
2727
2728 /**
2729 * Options for the watcher.
2730 */
2731 watchOptions?: WatchOptions;
2732}
2733type ConnectionState =
2734 | boolean
2735 | typeof TRANSITIVE_ONLY
2736 | typeof CIRCULAR_CONNECTION;
2737declare class ConstDependency extends NullDependency {
2738 constructor(
2739 expression: string,
2740 range: number | [number, number],
2741 runtimeRequirements?: null | string[]
2742 );
2743 expression: string;
2744 range: number | [number, number];
2745 runtimeRequirements: null | Set<string>;
2746 static Template: typeof ConstDependencyTemplate;
2747 static NO_EXPORTS_REFERENCED: string[][];
2748 static EXPORTS_OBJECT_REFERENCED: string[][];
2749 static TRANSITIVE: typeof TRANSITIVE;
2750}
2751declare class ConstDependencyTemplate extends NullDependencyTemplate {
2752 constructor();
2753}
2754declare interface Constructor {
2755 new (...params: any[]): any;
2756}
2757declare class ConsumeSharedPlugin {
2758 constructor(options: ConsumeSharedPluginOptions);
2759
2760 /**
2761 * Apply the plugin
2762 */
2763 apply(compiler: Compiler): void;
2764}
2765
2766/**
2767 * Options for consuming shared modules.
2768 */
2769declare interface ConsumeSharedPluginOptions {
2770 /**
2771 * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
2772 */
2773 consumes: Consumes;
2774
2775 /**
2776 * Share scope name used for all consumed modules (defaults to 'default').
2777 */
2778 shareScope?: string;
2779}
2780type Consumes = (string | ConsumesObject)[] | ConsumesObject;
2781
2782/**
2783 * Advanced configuration for modules that should be consumed from share scope.
2784 */
2785declare interface ConsumesConfig {
2786 /**
2787 * Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.
2788 */
2789 eager?: boolean;
2790
2791 /**
2792 * Fallback module if no shared module is found in share scope. Defaults to the property name.
2793 */
2794 import?: string | false;
2795
2796 /**
2797 * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
2798 */
2799 packageName?: string;
2800
2801 /**
2802 * Version requirement from module in share scope.
2803 */
2804 requiredVersion?: string | false;
2805
2806 /**
2807 * Module is looked up under this key from the share scope.
2808 */
2809 shareKey?: string;
2810
2811 /**
2812 * Share scope name.
2813 */
2814 shareScope?: string;
2815
2816 /**
2817 * Allow only a single version of the shared module in share scope (disabled by default).
2818 */
2819 singleton?: boolean;
2820
2821 /**
2822 * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
2823 */
2824 strictVersion?: boolean;
2825}
2826
2827/**
2828 * Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
2829 */
2830declare interface ConsumesObject {
2831 [index: string]: string | ConsumesConfig;
2832}
2833type ContainerOptionsFormat<T> = Item<T> | (string | Item<T>)[];
2834declare class ContainerPlugin {
2835 constructor(options: ContainerPluginOptions);
2836
2837 /**
2838 * Apply the plugin
2839 */
2840 apply(compiler: Compiler): void;
2841}
2842declare interface ContainerPluginOptions {
2843 /**
2844 * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
2845 */
2846 exposes: Exposes;
2847
2848 /**
2849 * The filename for this container relative path inside the `output.path` directory.
2850 */
2851 filename?: string;
2852
2853 /**
2854 * Options for library.
2855 */
2856 library?: LibraryOptions;
2857
2858 /**
2859 * The name for this container.
2860 */
2861 name: string;
2862
2863 /**
2864 * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
2865 */
2866 runtime?: string | false;
2867
2868 /**
2869 * The name of the share scope which is shared with the host (defaults to 'default').
2870 */
2871 shareScope?: string;
2872}
2873declare class ContainerReferencePlugin {
2874 constructor(options: ContainerReferencePluginOptions);
2875
2876 /**
2877 * Apply the plugin
2878 */
2879 apply(compiler: Compiler): void;
2880}
2881declare interface ContainerReferencePluginOptions {
2882 /**
2883 * The external type of the remote containers.
2884 */
2885 remoteType: ExternalsType;
2886
2887 /**
2888 * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
2889 */
2890 remotes: Remotes;
2891
2892 /**
2893 * The name of the share scope shared with all remotes (defaults to 'default').
2894 */
2895 shareScope?: string;
2896}
2897declare interface ContextAlternativeRequest {
2898 context: string;
2899 request: string;
2900}
2901declare abstract class ContextElementDependency extends ModuleDependency {
2902 referencedExports?: null | string[][];
2903}
2904declare class ContextExclusionPlugin {
2905 constructor(negativeMatcher: RegExp);
2906 negativeMatcher: RegExp;
2907
2908 /**
2909 * Apply the plugin
2910 */
2911 apply(compiler: Compiler): void;
2912}
2913declare interface ContextFileSystemInfoEntry {
2914 safeTime: number;
2915 timestampHash?: string;
2916 resolved?: ResolvedContextFileSystemInfoEntry;
2917 symlinks?: Set<string>;
2918}
2919declare interface ContextHash {
2920 hash: string;
2921 resolved?: string;
2922 symlinks?: Set<string>;
2923}
2924type ContextMode =
2925 | "weak"
2926 | "eager"
2927 | "lazy"
2928 | "lazy-once"
2929 | "sync"
2930 | "async-weak";
2931declare abstract class ContextModuleFactory extends ModuleFactory {
2932 hooks: Readonly<{
2933 beforeResolve: AsyncSeriesWaterfallHook<[any]>;
2934 afterResolve: AsyncSeriesWaterfallHook<[any]>;
2935 contextModuleFiles: SyncWaterfallHook<[string[]]>;
2936 alternatives: FakeHook<
2937 Pick<
2938 AsyncSeriesWaterfallHook<[ContextAlternativeRequest[]]>,
2939 "name" | "tap" | "tapAsync" | "tapPromise"
2940 >
2941 >;
2942 alternativeRequests: AsyncSeriesWaterfallHook<
2943 [ContextAlternativeRequest[], ContextModuleOptions]
2944 >;
2945 }>;
2946 resolverFactory: ResolverFactory;
2947 resolveDependencies(
2948 fs: InputFileSystem,
2949 options: ContextModuleOptions,
2950 callback: (
2951 err: null | Error,
2952 dependencies?: ContextElementDependency[]
2953 ) => any
2954 ): void;
2955}
2956
2957declare interface ContextModuleOptions {
2958 mode: ContextMode;
2959 recursive: boolean;
2960 regExp: RegExp;
2961 namespaceObject?: boolean | "strict";
2962 addon?: string;
2963 chunkName?: string;
2964 include?: RegExp;
2965 exclude?: RegExp;
2966 groupOptions?: RawChunkGroupOptions;
2967 typePrefix?: string;
2968 category?: string;
2969
2970 /**
2971 * exports referenced from modules (won't be mangled)
2972 */
2973 referencedExports?: null | string[][];
2974 layer?: string;
2975 attributes?: ImportAttributes;
2976 resource: string | false | string[];
2977 resourceQuery?: string;
2978 resourceFragment?: string;
2979 resolveOptions: any;
2980}
2981declare class ContextReplacementPlugin {
2982 constructor(
2983 resourceRegExp: RegExp,
2984 newContentResource?: any,
2985 newContentRecursive?: any,
2986 newContentRegExp?: RegExp
2987 );
2988 resourceRegExp: RegExp;
2989 newContentCallback: any;
2990 newContentResource: any;
2991 newContentCreateContextMap: any;
2992 newContentRecursive: any;
2993 newContentRegExp?: RegExp;
2994
2995 /**
2996 * Apply the plugin
2997 */
2998 apply(compiler: Compiler): void;
2999}
3000declare interface ContextTimestampAndHash {
3001 safeTime: number;
3002 timestampHash?: string;
3003 hash: string;
3004 resolved?: ResolvedContextTimestampAndHash;
3005 symlinks?: Set<string>;
3006}
3007type CreateStatsOptionsContext = Record<string, any> &
3008 KnownCreateStatsOptionsContext;
3009type CreateWriteStreamFSImplementation = FSImplementation & {
3010 write: (...args: any[]) => any;
3011 close?: (...args: any[]) => any;
3012};
3013
3014/**
3015 * Generator options for css/auto modules.
3016 */
3017declare interface CssAutoGeneratorOptions {
3018 /**
3019 * Configure the generated JS modules that use the ES modules syntax.
3020 */
3021 esModule?: boolean;
3022
3023 /**
3024 * Specifies the convention of exported names.
3025 */
3026 exportsConvention?:
3027 | "as-is"
3028 | "camel-case"
3029 | "camel-case-only"
3030 | "dashes"
3031 | "dashes-only"
3032 | ((name: string) => string);
3033
3034 /**
3035 * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
3036 */
3037 exportsOnly?: boolean;
3038
3039 /**
3040 * Configure the generated local ident name.
3041 */
3042 localIdentName?: string;
3043}
3044
3045/**
3046 * Parser options for css/auto modules.
3047 */
3048declare interface CssAutoParserOptions {
3049 /**
3050 * Use ES modules named export for css exports.
3051 */
3052 namedExports?: boolean;
3053}
3054
3055/**
3056 * Generator options for css modules.
3057 */
3058declare interface CssGeneratorOptions {
3059 /**
3060 * Configure the generated JS modules that use the ES modules syntax.
3061 */
3062 esModule?: boolean;
3063
3064 /**
3065 * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
3066 */
3067 exportsOnly?: boolean;
3068}
3069
3070/**
3071 * Generator options for css/global modules.
3072 */
3073declare interface CssGlobalGeneratorOptions {
3074 /**
3075 * Configure the generated JS modules that use the ES modules syntax.
3076 */
3077 esModule?: boolean;
3078
3079 /**
3080 * Specifies the convention of exported names.
3081 */
3082 exportsConvention?:
3083 | "as-is"
3084 | "camel-case"
3085 | "camel-case-only"
3086 | "dashes"
3087 | "dashes-only"
3088 | ((name: string) => string);
3089
3090 /**
3091 * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
3092 */
3093 exportsOnly?: boolean;
3094
3095 /**
3096 * Configure the generated local ident name.
3097 */
3098 localIdentName?: string;
3099}
3100
3101/**
3102 * Parser options for css/global modules.
3103 */
3104declare interface CssGlobalParserOptions {
3105 /**
3106 * Use ES modules named export for css exports.
3107 */
3108 namedExports?: boolean;
3109}
3110declare interface CssImportDependencyMeta {
3111 layer?: string;
3112 supports?: string;
3113 media?: string;
3114}
3115
3116/**
3117 * Generator options for css/module modules.
3118 */
3119declare interface CssModuleGeneratorOptions {
3120 /**
3121 * Configure the generated JS modules that use the ES modules syntax.
3122 */
3123 esModule?: boolean;
3124
3125 /**
3126 * Specifies the convention of exported names.
3127 */
3128 exportsConvention?:
3129 | "as-is"
3130 | "camel-case"
3131 | "camel-case-only"
3132 | "dashes"
3133 | "dashes-only"
3134 | ((name: string) => string);
3135
3136 /**
3137 * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
3138 */
3139 exportsOnly?: boolean;
3140
3141 /**
3142 * Configure the generated local ident name.
3143 */
3144 localIdentName?: string;
3145}
3146
3147/**
3148 * Parser options for css/module modules.
3149 */
3150declare interface CssModuleParserOptions {
3151 /**
3152 * Use ES modules named export for css exports.
3153 */
3154 namedExports?: boolean;
3155}
3156
3157/**
3158 * Parser options for css modules.
3159 */
3160declare interface CssParserOptions {
3161 /**
3162 * Use ES modules named export for css exports.
3163 */
3164 namedExports?: boolean;
3165}
3166type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
3167declare class DefinePlugin {
3168 /**
3169 * Create a new define plugin
3170 */
3171 constructor(definitions: Record<string, CodeValue>);
3172 definitions: Record<string, CodeValue>;
3173
3174 /**
3175 * Apply the plugin
3176 */
3177 apply(compiler: Compiler): void;
3178 static runtimeValue(
3179 fn: (arg0: {
3180 module: NormalModule;
3181 key: string;
3182 readonly version: ValueCacheVersion;
3183 }) => CodeValuePrimitive,
3184 options?: true | string[] | RuntimeValueOptions
3185 ): RuntimeValue;
3186}
3187declare class DelegatedPlugin {
3188 constructor(options: Options);
3189 options: Options;
3190
3191 /**
3192 * Apply the plugin
3193 */
3194 apply(compiler: Compiler): void;
3195}
3196declare interface DepConstructor {
3197 new (...args: any[]): Dependency;
3198}
3199declare abstract class DependenciesBlock {
3200 dependencies: Dependency[];
3201 blocks: AsyncDependenciesBlock[];
3202 parent?: DependenciesBlock;
3203 getRootBlock(): DependenciesBlock;
3204
3205 /**
3206 * Adds a DependencyBlock to DependencyBlock relationship.
3207 * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
3208 */
3209 addBlock(block: AsyncDependenciesBlock): void;
3210 addDependency(dependency: Dependency): void;
3211 removeDependency(dependency: Dependency): void;
3212
3213 /**
3214 * Removes all dependencies and blocks
3215 */
3216 clearDependenciesAndBlocks(): void;
3217 updateHash(hash: Hash, context: UpdateHashContextDependency): void;
3218 serialize(__0: ObjectSerializerContext): void;
3219 deserialize(__0: ObjectDeserializerContext): void;
3220}
3221declare interface DependenciesBlockLike {
3222 dependencies: Dependency[];
3223 blocks: AsyncDependenciesBlock[];
3224}
3225declare class Dependency {
3226 constructor();
3227 weak: boolean;
3228 optional: boolean;
3229 get type(): string;
3230 get category(): string;
3231 loc: DependencyLocation;
3232 setLoc(
3233 startLine: number,
3234 startColumn: number,
3235 endLine: number,
3236 endColumn: number
3237 ): void;
3238 getContext(): undefined | string;
3239 getResourceIdentifier(): null | string;
3240 couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
3241
3242 /**
3243 * Returns the referenced module and export
3244 */
3245 getReference(moduleGraph: ModuleGraph): never;
3246
3247 /**
3248 * Returns list of exports referenced by this dependency
3249 */
3250 getReferencedExports(
3251 moduleGraph: ModuleGraph,
3252 runtime: RuntimeSpec
3253 ): (string[] | ReferencedExport)[];
3254 getCondition(
3255 moduleGraph: ModuleGraph
3256 ):
3257 | null
3258 | false
3259 | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
3260
3261 /**
3262 * Returns the exported names
3263 */
3264 getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
3265
3266 /**
3267 * Returns warnings
3268 */
3269 getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
3270
3271 /**
3272 * Returns errors
3273 */
3274 getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
3275
3276 /**
3277 * Update the hash
3278 */
3279 updateHash(hash: Hash, context: UpdateHashContextDependency): void;
3280
3281 /**
3282 * implement this method to allow the occurrence order plugin to count correctly
3283 */
3284 getNumberOfIdOccurrences(): number;
3285 getModuleEvaluationSideEffectsState(
3286 moduleGraph: ModuleGraph
3287 ): ConnectionState;
3288 createIgnoredModule(context: string): null | Module;
3289 serialize(__0: ObjectSerializerContext): void;
3290 deserialize(__0: ObjectDeserializerContext): void;
3291 module: any;
3292 get disconnect(): any;
3293 static NO_EXPORTS_REFERENCED: string[][];
3294 static EXPORTS_OBJECT_REFERENCED: string[][];
3295 static TRANSITIVE: typeof TRANSITIVE;
3296}
3297declare interface DependencyConstructor {
3298 new (...args: any[]): Dependency;
3299}
3300type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
3301declare class DependencyTemplate {
3302 constructor();
3303 apply(
3304 dependency: Dependency,
3305 source: ReplaceSource,
3306 templateContext: DependencyTemplateContext
3307 ): void;
3308}
3309declare interface DependencyTemplateContext {
3310 /**
3311 * the runtime template
3312 */
3313 runtimeTemplate: RuntimeTemplate;
3314
3315 /**
3316 * the dependency templates
3317 */
3318 dependencyTemplates: DependencyTemplates;
3319
3320 /**
3321 * the module graph
3322 */
3323 moduleGraph: ModuleGraph;
3324
3325 /**
3326 * the chunk graph
3327 */
3328 chunkGraph: ChunkGraph;
3329
3330 /**
3331 * the requirements for runtime
3332 */
3333 runtimeRequirements: Set<string>;
3334
3335 /**
3336 * current module
3337 */
3338 module: Module;
3339
3340 /**
3341 * current runtimes, for which code is generated
3342 */
3343 runtime: RuntimeSpec;
3344
3345 /**
3346 * mutable array of init fragments for the current module
3347 */
3348 initFragments: InitFragment<GenerateContext>[];
3349
3350 /**
3351 * when in a concatenated module, information about other concatenated modules
3352 */
3353 concatenationScope?: ConcatenationScope;
3354
3355 /**
3356 * the code generation results
3357 */
3358 codeGenerationResults: CodeGenerationResults;
3359
3360 /**
3361 * chunkInitFragments
3362 */
3363 chunkInitFragments: InitFragment<GenerateContext>[];
3364}
3365declare abstract class DependencyTemplates {
3366 get(dependency: DependencyConstructor): undefined | DependencyTemplate;
3367 set(
3368 dependency: DependencyConstructor,
3369 dependencyTemplate: DependencyTemplate
3370 ): void;
3371 updateHash(part: string): void;
3372 getHash(): string;
3373 clone(): DependencyTemplates;
3374}
3375
3376/**
3377 * Helper function for joining two ranges into a single range. This is useful
3378 * when working with AST nodes, as it allows you to combine the ranges of child nodes
3379 * to create the range of the _parent node_.
3380 */
3381declare interface DestructuringAssignmentProperty {
3382 id: string;
3383 range?: [number, number];
3384 shorthand: string | boolean;
3385}
3386declare class DeterministicChunkIdsPlugin {
3387 constructor(options?: DeterministicChunkIdsPluginOptions);
3388 options: DeterministicChunkIdsPluginOptions;
3389
3390 /**
3391 * Apply the plugin
3392 */
3393 apply(compiler: Compiler): void;
3394}
3395declare interface DeterministicChunkIdsPluginOptions {
3396 /**
3397 * context for ids
3398 */
3399 context?: string;
3400
3401 /**
3402 * maximum length of ids
3403 */
3404 maxLength?: number;
3405}
3406declare class DeterministicModuleIdsPlugin {
3407 constructor(options?: DeterministicModuleIdsPluginOptions);
3408 options: DeterministicModuleIdsPluginOptions;
3409
3410 /**
3411 * Apply the plugin
3412 */
3413 apply(compiler: Compiler): void;
3414}
3415declare interface DeterministicModuleIdsPluginOptions {
3416 /**
3417 * context relative to which module identifiers are computed
3418 */
3419 context?: string;
3420
3421 /**
3422 * selector function for modules
3423 */
3424 test?: (arg0: Module) => boolean;
3425
3426 /**
3427 * maximum id length in digits (used as starting point)
3428 */
3429 maxLength?: number;
3430
3431 /**
3432 * hash salt for ids
3433 */
3434 salt?: number;
3435
3436 /**
3437 * do not increase the maxLength to find an optimal id space size
3438 */
3439 fixedLength?: boolean;
3440
3441 /**
3442 * throw an error when id conflicts occur (instead of rehashing)
3443 */
3444 failOnConflict?: boolean;
3445}
3446type DevtoolModuleFilenameTemplate = string | Function;
3447declare interface Dirent {
3448 isFile: () => boolean;
3449 isDirectory: () => boolean;
3450 isBlockDevice: () => boolean;
3451 isCharacterDevice: () => boolean;
3452 isSymbolicLink: () => boolean;
3453 isFIFO: () => boolean;
3454 isSocket: () => boolean;
3455 name: string;
3456 path: string;
3457}
3458declare class DllPlugin {
3459 constructor(options: DllPluginOptions);
3460 options: {
3461 entryOnly: boolean;
3462 /**
3463 * Context of requests in the manifest file (defaults to the webpack context).
3464 */
3465 context?: string;
3466 /**
3467 * If true, manifest json file (output) will be formatted.
3468 */
3469 format?: boolean;
3470 /**
3471 * Name of the exposed dll function (external name, use value of 'output.library').
3472 */
3473 name?: string;
3474 /**
3475 * Absolute path to the manifest json file (output).
3476 */
3477 path: string;
3478 /**
3479 * Type of the dll bundle (external type, use value of 'output.libraryTarget').
3480 */
3481 type?: string;
3482 };
3483
3484 /**
3485 * Apply the plugin
3486 */
3487 apply(compiler: Compiler): void;
3488}
3489declare interface DllPluginOptions {
3490 /**
3491 * Context of requests in the manifest file (defaults to the webpack context).
3492 */
3493 context?: string;
3494
3495 /**
3496 * If true, only entry points will be exposed (default: true).
3497 */
3498 entryOnly?: boolean;
3499
3500 /**
3501 * If true, manifest json file (output) will be formatted.
3502 */
3503 format?: boolean;
3504
3505 /**
3506 * Name of the exposed dll function (external name, use value of 'output.library').
3507 */
3508 name?: string;
3509
3510 /**
3511 * Absolute path to the manifest json file (output).
3512 */
3513 path: string;
3514
3515 /**
3516 * Type of the dll bundle (external type, use value of 'output.libraryTarget').
3517 */
3518 type?: string;
3519}
3520declare class DllReferencePlugin {
3521 constructor(options: DllReferencePluginOptions);
3522 options: DllReferencePluginOptions;
3523
3524 /**
3525 * Apply the plugin
3526 */
3527 apply(compiler: Compiler): void;
3528}
3529type DllReferencePluginOptions =
3530 | {
3531 /**
3532 * Context of requests in the manifest (or content property) as absolute path.
3533 */
3534 context?: string;
3535 /**
3536 * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
3537 */
3538 extensions?: string[];
3539 /**
3540 * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
3541 */
3542 manifest: string | DllReferencePluginOptionsManifest;
3543 /**
3544 * The name where the dll is exposed (external name, defaults to manifest.name).
3545 */
3546 name?: string;
3547 /**
3548 * Prefix which is used for accessing the content of the dll.
3549 */
3550 scope?: string;
3551 /**
3552 * How the dll is exposed (libraryTarget, defaults to manifest.type).
3553 */
3554 sourceType?:
3555 | "var"
3556 | "assign"
3557 | "this"
3558 | "window"
3559 | "global"
3560 | "commonjs"
3561 | "commonjs2"
3562 | "commonjs-module"
3563 | "amd"
3564 | "amd-require"
3565 | "umd"
3566 | "umd2"
3567 | "jsonp"
3568 | "system";
3569 /**
3570 * The way how the export of the dll bundle is used.
3571 */
3572 type?: "object" | "require";
3573 }
3574 | {
3575 /**
3576 * The mappings from request to module info.
3577 */
3578 content: DllReferencePluginOptionsContent;
3579 /**
3580 * Context of requests in the manifest (or content property) as absolute path.
3581 */
3582 context?: string;
3583 /**
3584 * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
3585 */
3586 extensions?: string[];
3587 /**
3588 * The name where the dll is exposed (external name).
3589 */
3590 name: string;
3591 /**
3592 * Prefix which is used for accessing the content of the dll.
3593 */
3594 scope?: string;
3595 /**
3596 * How the dll is exposed (libraryTarget).
3597 */
3598 sourceType?:
3599 | "var"
3600 | "assign"
3601 | "this"
3602 | "window"
3603 | "global"
3604 | "commonjs"
3605 | "commonjs2"
3606 | "commonjs-module"
3607 | "amd"
3608 | "amd-require"
3609 | "umd"
3610 | "umd2"
3611 | "jsonp"
3612 | "system";
3613 /**
3614 * The way how the export of the dll bundle is used.
3615 */
3616 type?: "object" | "require";
3617 };
3618
3619/**
3620 * The mappings from request to module info.
3621 */
3622declare interface DllReferencePluginOptionsContent {
3623 [index: string]: {
3624 /**
3625 * Meta information about the module.
3626 */
3627 buildMeta?: { [index: string]: any };
3628 /**
3629 * Information about the provided exports of the module.
3630 */
3631 exports?: true | string[];
3632 /**
3633 * Module ID.
3634 */
3635 id: string | number;
3636 };
3637}
3638
3639/**
3640 * An object containing content, name and type.
3641 */
3642declare interface DllReferencePluginOptionsManifest {
3643 /**
3644 * The mappings from request to module info.
3645 */
3646 content: DllReferencePluginOptionsContent;
3647
3648 /**
3649 * The name where the dll is exposed (external name).
3650 */
3651 name?: string;
3652
3653 /**
3654 * The type how the dll is exposed (external type).
3655 */
3656 type?:
3657 | "var"
3658 | "assign"
3659 | "this"
3660 | "window"
3661 | "global"
3662 | "commonjs"
3663 | "commonjs2"
3664 | "commonjs-module"
3665 | "amd"
3666 | "amd-require"
3667 | "umd"
3668 | "umd2"
3669 | "jsonp"
3670 | "system";
3671}
3672declare class DynamicEntryPlugin {
3673 constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
3674 context: string;
3675 entry: () => Promise<EntryStaticNormalized>;
3676
3677 /**
3678 * Apply the plugin
3679 */
3680 apply(compiler: Compiler): void;
3681}
3682declare interface Effect {
3683 type: string;
3684 value: any;
3685}
3686declare interface EffectData {
3687 [index: string]: any;
3688}
3689declare class ElectronTargetPlugin {
3690 constructor(context?: "main" | "preload" | "renderer");
3691
3692 /**
3693 * Apply the plugin
3694 */
3695 apply(compiler: Compiler): void;
3696}
3697
3698/**
3699 * No generator options are supported for this module type.
3700 */
3701declare interface EmptyGeneratorOptions {}
3702
3703/**
3704 * No parser options are supported for this module type.
3705 */
3706declare interface EmptyParserOptions {}
3707declare class EnableChunkLoadingPlugin {
3708 constructor(type: string);
3709 type: string;
3710
3711 /**
3712 * Apply the plugin
3713 */
3714 apply(compiler: Compiler): void;
3715 static setEnabled(compiler: Compiler, type: string): void;
3716 static checkEnabled(compiler: Compiler, type: string): void;
3717}
3718declare class EnableLibraryPlugin {
3719 constructor(type: string);
3720 type: string;
3721
3722 /**
3723 * Apply the plugin
3724 */
3725 apply(compiler: Compiler): void;
3726 static setEnabled(compiler: Compiler, type: string): void;
3727 static checkEnabled(compiler: Compiler, type: string): void;
3728}
3729declare class EnableWasmLoadingPlugin {
3730 constructor(type: string);
3731 type: string;
3732
3733 /**
3734 * Apply the plugin
3735 */
3736 apply(compiler: Compiler): void;
3737 static setEnabled(compiler: Compiler, type: string): void;
3738 static checkEnabled(compiler: Compiler, type: string): void;
3739}
3740type EncodingOption =
3741 | undefined
3742 | null
3743 | "ascii"
3744 | "utf8"
3745 | "utf-8"
3746 | "utf16le"
3747 | "utf-16le"
3748 | "ucs2"
3749 | "ucs-2"
3750 | "latin1"
3751 | "binary"
3752 | "base64"
3753 | "base64url"
3754 | "hex"
3755 | ObjectEncodingOptions;
3756type Entry =
3757 | string
3758 | (() => string | EntryObject | string[] | Promise<EntryStatic>)
3759 | EntryObject
3760 | string[];
3761declare interface EntryData {
3762 /**
3763 * dependencies of the entrypoint that should be evaluated at startup
3764 */
3765 dependencies: Dependency[];
3766
3767 /**
3768 * dependencies of the entrypoint that should be included but not evaluated
3769 */
3770 includeDependencies: Dependency[];
3771
3772 /**
3773 * options of the entrypoint
3774 */
3775 options: EntryOptions;
3776}
3777declare abstract class EntryDependency extends ModuleDependency {}
3778
3779/**
3780 * An object with entry point description.
3781 */
3782declare interface EntryDescription {
3783 /**
3784 * Enable/disable creating async chunks that are loaded on demand.
3785 */
3786 asyncChunks?: boolean;
3787
3788 /**
3789 * Base uri for this entry.
3790 */
3791 baseUri?: string;
3792
3793 /**
3794 * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
3795 */
3796 chunkLoading?: string | false;
3797
3798 /**
3799 * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
3800 */
3801 dependOn?: string | string[];
3802
3803 /**
3804 * Specifies the filename of the output file on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
3805 */
3806 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
3807
3808 /**
3809 * Module(s) that are loaded upon startup.
3810 */
3811 import: EntryItem;
3812
3813 /**
3814 * Specifies the layer in which modules of this entrypoint are placed.
3815 */
3816 layer?: null | string;
3817
3818 /**
3819 * Options for library.
3820 */
3821 library?: LibraryOptions;
3822
3823 /**
3824 * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
3825 */
3826 publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
3827
3828 /**
3829 * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
3830 */
3831 runtime?: string | false;
3832
3833 /**
3834 * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
3835 */
3836 wasmLoading?: string | false;
3837}
3838
3839/**
3840 * An object with entry point description.
3841 */
3842declare interface EntryDescriptionNormalized {
3843 /**
3844 * Enable/disable creating async chunks that are loaded on demand.
3845 */
3846 asyncChunks?: boolean;
3847
3848 /**
3849 * Base uri for this entry.
3850 */
3851 baseUri?: string;
3852
3853 /**
3854 * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
3855 */
3856 chunkLoading?: string | false;
3857
3858 /**
3859 * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
3860 */
3861 dependOn?: string[];
3862
3863 /**
3864 * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
3865 */
3866 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
3867
3868 /**
3869 * Module(s) that are loaded upon startup. The last one is exported.
3870 */
3871 import?: string[];
3872
3873 /**
3874 * Specifies the layer in which modules of this entrypoint are placed.
3875 */
3876 layer?: null | string;
3877
3878 /**
3879 * Options for library.
3880 */
3881 library?: LibraryOptions;
3882
3883 /**
3884 * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
3885 */
3886 publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
3887
3888 /**
3889 * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
3890 */
3891 runtime?: string | false;
3892
3893 /**
3894 * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
3895 */
3896 wasmLoading?: string | false;
3897}
3898type EntryItem = string | string[];
3899type EntryNormalized =
3900 | (() => Promise<EntryStaticNormalized>)
3901 | EntryStaticNormalized;
3902
3903/**
3904 * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
3905 */
3906declare interface EntryObject {
3907 [index: string]: string | string[] | EntryDescription;
3908}
3909declare class EntryOptionPlugin {
3910 constructor();
3911 apply(compiler: Compiler): void;
3912 static applyEntryOption(
3913 compiler: Compiler,
3914 context: string,
3915 entry: EntryNormalized
3916 ): void;
3917 static entryDescriptionToOptions(
3918 compiler: Compiler,
3919 name: string,
3920 desc: EntryDescriptionNormalized
3921 ): EntryOptions;
3922}
3923type EntryOptions = { name?: string } & Omit<
3924 EntryDescriptionNormalized,
3925 "import"
3926>;
3927declare class EntryPlugin {
3928 /**
3929 * An entry plugin which will handle creation of the EntryDependency
3930 */
3931 constructor(context: string, entry: string, options?: string | EntryOptions);
3932 context: string;
3933 entry: string;
3934 options: string | EntryOptions;
3935
3936 /**
3937 * Apply the plugin
3938 */
3939 apply(compiler: Compiler): void;
3940 static createDependency(
3941 entry: string,
3942 options: string | EntryOptions
3943 ): EntryDependency;
3944}
3945type EntryStatic = string | EntryObject | string[];
3946
3947/**
3948 * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
3949 */
3950declare interface EntryStaticNormalized {
3951 [index: string]: EntryDescriptionNormalized;
3952}
3953declare abstract class Entrypoint extends ChunkGroup {
3954 /**
3955 * Sets the runtimeChunk for an entrypoint.
3956 */
3957 setRuntimeChunk(chunk: Chunk): void;
3958
3959 /**
3960 * Fetches the chunk reference containing the webpack bootstrap code
3961 */
3962 getRuntimeChunk(): null | Chunk;
3963
3964 /**
3965 * Sets the chunk with the entrypoint modules for an entrypoint.
3966 */
3967 setEntrypointChunk(chunk: Chunk): void;
3968
3969 /**
3970 * Returns the chunk which contains the entrypoint modules
3971 * (or at least the execution of them)
3972 */
3973 getEntrypointChunk(): Chunk;
3974}
3975
3976/**
3977 * The abilities of the environment where the webpack generated code should run.
3978 */
3979declare interface Environment {
3980 /**
3981 * The environment supports arrow functions ('() => { ... }').
3982 */
3983 arrowFunction?: boolean;
3984
3985 /**
3986 * The environment supports async function and await ('async function () { await ... }').
3987 */
3988 asyncFunction?: boolean;
3989
3990 /**
3991 * The environment supports BigInt as literal (123n).
3992 */
3993 bigIntLiteral?: boolean;
3994
3995 /**
3996 * The environment supports const and let for variable declarations.
3997 */
3998 const?: boolean;
3999
4000 /**
4001 * The environment supports destructuring ('{ a, b } = obj').
4002 */
4003 destructuring?: boolean;
4004
4005 /**
4006 * The environment supports 'document'.
4007 */
4008 document?: boolean;
4009
4010 /**
4011 * The environment supports an async import() function to import EcmaScript modules.
4012 */
4013 dynamicImport?: boolean;
4014
4015 /**
4016 * The environment supports an async import() is available when creating a worker.
4017 */
4018 dynamicImportInWorker?: boolean;
4019
4020 /**
4021 * The environment supports 'for of' iteration ('for (const x of array) { ... }').
4022 */
4023 forOf?: boolean;
4024
4025 /**
4026 * The environment supports 'globalThis'.
4027 */
4028 globalThis?: boolean;
4029
4030 /**
4031 * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
4032 */
4033 module?: boolean;
4034
4035 /**
4036 * The environment supports `node:` prefix for Node.js core modules.
4037 */
4038 nodePrefixForCoreModules?: boolean;
4039
4040 /**
4041 * The environment supports optional chaining ('obj?.a' or 'obj?.()').
4042 */
4043 optionalChaining?: boolean;
4044
4045 /**
4046 * The environment supports template literals.
4047 */
4048 templateLiteral?: boolean;
4049}
4050declare class EnvironmentPlugin {
4051 constructor(...keys: (string | string[] | Record<string, any>)[]);
4052 keys: string[];
4053 defaultValues: Record<string, any>;
4054
4055 /**
4056 * Apply the plugin
4057 */
4058 apply(compiler: Compiler): void;
4059}
4060type ErrorWithDetail = Error & { details?: string };
4061declare interface Etag {
4062 toString: () => string;
4063}
4064declare class EvalDevToolModulePlugin {
4065 constructor(options?: EvalDevToolModulePluginOptions);
4066 namespace: string;
4067 sourceUrlComment: string;
4068 moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
4069
4070 /**
4071 * Apply the plugin
4072 */
4073 apply(compiler: Compiler): void;
4074}
4075declare interface EvalDevToolModulePluginOptions {
4076 /**
4077 * namespace
4078 */
4079 namespace?: string;
4080
4081 /**
4082 * source url comment
4083 */
4084 sourceUrlComment?: string;
4085
4086 /**
4087 * module filename template
4088 */
4089 moduleFilenameTemplate?: string | Function;
4090}
4091declare class EvalSourceMapDevToolPlugin {
4092 constructor(inputOptions: string | SourceMapDevToolPluginOptions);
4093 sourceMapComment: string;
4094 moduleFilenameTemplate: string | Function;
4095 namespace: string;
4096 options: SourceMapDevToolPluginOptions;
4097
4098 /**
4099 * Apply the plugin
4100 */
4101 apply(compiler: Compiler): void;
4102}
4103declare interface ExecuteModuleArgument {
4104 module: Module;
4105 moduleObject?: { id: string; exports: any; loaded: boolean };
4106 preparedInfo: any;
4107 codeGenerationResult: CodeGenerationResult;
4108}
4109declare interface ExecuteModuleContext {
4110 assets: Map<string, { source: Source; info: AssetInfo }>;
4111 chunk: Chunk;
4112 chunkGraph: ChunkGraph;
4113 __webpack_require__?: (arg0: string) => any;
4114}
4115declare interface ExecuteModuleOptions {
4116 entryOptions?: EntryOptions;
4117}
4118declare interface ExecuteModuleResult {
4119 exports: any;
4120 cacheable: boolean;
4121 assets: Map<string, { source: Source; info: AssetInfo }>;
4122 fileDependencies: LazySet<string>;
4123 contextDependencies: LazySet<string>;
4124 missingDependencies: LazySet<string>;
4125 buildDependencies: LazySet<string>;
4126}
4127type Experiments = ExperimentsCommon & ExperimentsExtra;
4128
4129/**
4130 * Enables/Disables experiments (experimental features with relax SemVer compatibility).
4131 */
4132declare interface ExperimentsCommon {
4133 /**
4134 * Support WebAssembly as asynchronous EcmaScript Module.
4135 */
4136 asyncWebAssembly?: boolean;
4137
4138 /**
4139 * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
4140 */
4141 backCompat?: boolean;
4142
4143 /**
4144 * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
4145 */
4146 cacheUnaffected?: boolean;
4147
4148 /**
4149 * Apply defaults of next major version.
4150 */
4151 futureDefaults?: boolean;
4152
4153 /**
4154 * Enable module layers.
4155 */
4156 layers?: boolean;
4157
4158 /**
4159 * Allow output javascript files as module source type.
4160 */
4161 outputModule?: boolean;
4162
4163 /**
4164 * Support WebAssembly as synchronous EcmaScript Module (outdated).
4165 */
4166 syncWebAssembly?: boolean;
4167
4168 /**
4169 * Allow using top-level-await in EcmaScript Modules.
4170 */
4171 topLevelAwait?: boolean;
4172}
4173
4174/**
4175 * Enables/Disables experiments (experimental features with relax SemVer compatibility).
4176 */
4177declare interface ExperimentsExtra {
4178 /**
4179 * Build http(s): urls using a lockfile and resource content cache.
4180 */
4181 buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
4182
4183 /**
4184 * Enable css support.
4185 */
4186 css?: boolean;
4187
4188 /**
4189 * Compile entrypoints and import()s only when they are accessed.
4190 */
4191 lazyCompilation?: boolean | LazyCompilationOptions;
4192}
4193type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
4194
4195/**
4196 * Enables/Disables experiments (experimental features with relax SemVer compatibility).
4197 */
4198declare interface ExperimentsNormalizedExtra {
4199 /**
4200 * Build http(s): urls using a lockfile and resource content cache.
4201 */
4202 buildHttp?: HttpUriOptions;
4203
4204 /**
4205 * Enable css support.
4206 */
4207 css?: boolean;
4208
4209 /**
4210 * Compile entrypoints and import()s only when they are accessed.
4211 */
4212 lazyCompilation?: false | LazyCompilationOptions;
4213}
4214declare abstract class ExportInfo {
4215 name: string;
4216
4217 /**
4218 * true: it is provided
4219 * false: it is not provided
4220 * null: only the runtime knows if it is provided
4221 * undefined: it was not determined if it is provided
4222 */
4223 provided?: null | boolean;
4224
4225 /**
4226 * is the export a terminal binding that should be checked for export star conflicts
4227 */
4228 terminalBinding: boolean;
4229
4230 /**
4231 * true: it can be mangled
4232 * false: is can not be mangled
4233 * undefined: it was not determined if it can be mangled
4234 */
4235 canMangleProvide?: boolean;
4236
4237 /**
4238 * true: it can be mangled
4239 * false: is can not be mangled
4240 * undefined: it was not determined if it can be mangled
4241 */
4242 canMangleUse?: boolean;
4243 exportsInfoOwned: boolean;
4244 exportsInfo?: ExportsInfo;
4245 get canMangle(): boolean;
4246 setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
4247 setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
4248 setHasUseInfo(): void;
4249 setUsedConditionally(
4250 condition: (arg0: UsageStateType) => boolean,
4251 newValue: UsageStateType,
4252 runtime: RuntimeSpec
4253 ): boolean;
4254 setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
4255 unsetTarget(key?: any): boolean;
4256 setTarget(
4257 key: any,
4258 connection: ModuleGraphConnection,
4259 exportName?: null | string[],
4260 priority?: number
4261 ): boolean;
4262 getUsed(runtime: RuntimeSpec): UsageStateType;
4263
4264 /**
4265 * get used name
4266 */
4267 getUsedName(
4268 fallbackName: undefined | string,
4269 runtime: RuntimeSpec
4270 ): string | false;
4271 hasUsedName(): boolean;
4272
4273 /**
4274 * Sets the mangled name of this export
4275 */
4276 setUsedName(name: string): void;
4277 getTerminalBinding(
4278 moduleGraph: ModuleGraph,
4279 resolveTargetFilter?: (arg0: TargetItem) => boolean
4280 ): undefined | ExportsInfo | ExportInfo;
4281 isReexport(): undefined | boolean;
4282 findTarget(
4283 moduleGraph: ModuleGraph,
4284 validTargetModuleFilter: (arg0: Module) => boolean
4285 ): undefined | null | false | TargetItemWithoutConnection;
4286 getTarget(
4287 moduleGraph: ModuleGraph,
4288 resolveTargetFilter?: (arg0: TargetItem) => boolean
4289 ): undefined | TargetItem;
4290
4291 /**
4292 * Move the target forward as long resolveTargetFilter is fulfilled
4293 */
4294 moveTarget(
4295 moduleGraph: ModuleGraph,
4296 resolveTargetFilter: (arg0: TargetItem) => boolean,
4297 updateOriginalConnection?: (arg0: TargetItem) => ModuleGraphConnection
4298 ): undefined | TargetItem;
4299 createNestedExportsInfo(): ExportsInfo;
4300 getNestedExportsInfo(): undefined | ExportsInfo;
4301 hasInfo(baseInfo: ExportInfo, runtime: RuntimeSpec): boolean;
4302 updateHash(hash: Hash, runtime: RuntimeSpec): void;
4303 getUsedInfo(): string;
4304 getProvidedInfo():
4305 | "no provided info"
4306 | "maybe provided (runtime-defined)"
4307 | "provided"
4308 | "not provided";
4309 getRenameInfo(): string;
4310}
4311declare interface ExportSpec {
4312 /**
4313 * the name of the export
4314 */
4315 name: string;
4316
4317 /**
4318 * can the export be renamed (defaults to true)
4319 */
4320 canMangle?: boolean;
4321
4322 /**
4323 * is the export a terminal binding that should be checked for export star conflicts
4324 */
4325 terminalBinding?: boolean;
4326
4327 /**
4328 * nested exports
4329 */
4330 exports?: (string | ExportSpec)[];
4331
4332 /**
4333 * when reexported: from which module
4334 */
4335 from?: ModuleGraphConnection;
4336
4337 /**
4338 * when reexported: from which export
4339 */
4340 export?: null | string[];
4341
4342 /**
4343 * when reexported: with which priority
4344 */
4345 priority?: number;
4346
4347 /**
4348 * export is not visible, because another export blends over it
4349 */
4350 hidden?: boolean;
4351}
4352type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
4353declare abstract class ExportsInfo {
4354 get ownedExports(): Iterable<ExportInfo>;
4355 get orderedOwnedExports(): Iterable<ExportInfo>;
4356 get exports(): Iterable<ExportInfo>;
4357 get orderedExports(): Iterable<ExportInfo>;
4358 get otherExportsInfo(): ExportInfo;
4359 setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
4360 setHasProvideInfo(): void;
4361 setHasUseInfo(): void;
4362 getOwnExportInfo(name: string): ExportInfo;
4363 getExportInfo(name: string): ExportInfo;
4364 getReadOnlyExportInfo(name: string): ExportInfo;
4365 getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
4366 getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
4367 setUnknownExportsProvided(
4368 canMangle?: boolean,
4369 excludeExports?: Set<string>,
4370 targetKey?: any,
4371 targetModule?: ModuleGraphConnection,
4372 priority?: number
4373 ): boolean;
4374 setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
4375 setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
4376 setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
4377 setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
4378 isUsed(runtime: RuntimeSpec): boolean;
4379 isModuleUsed(runtime: RuntimeSpec): boolean;
4380 getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
4381 getProvidedExports(): null | true | string[];
4382 getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
4383 isExportProvided(name: string | string[]): undefined | null | boolean;
4384 getUsageKey(runtime: RuntimeSpec): string;
4385 isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
4386 getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
4387 getUsedName(name: string | string[], runtime: RuntimeSpec): UsedName;
4388 updateHash(hash: Hash, runtime: RuntimeSpec): void;
4389 getRestoreProvidedData(): RestoreProvidedData;
4390 restoreProvided(__0: {
4391 otherProvided: any;
4392 otherCanMangleProvide: any;
4393 otherTerminalBinding: any;
4394 exports: any;
4395 }): void;
4396}
4397declare interface ExportsSpec {
4398 /**
4399 * exported names, true for unknown exports or null for no exports
4400 */
4401 exports: null | true | (string | ExportSpec)[];
4402
4403 /**
4404 * when exports = true, list of unaffected exports
4405 */
4406 excludeExports?: Set<string>;
4407
4408 /**
4409 * list of maybe prior exposed, but now hidden exports
4410 */
4411 hideExports?: null | Set<string>;
4412
4413 /**
4414 * when reexported: from which module
4415 */
4416 from?: ModuleGraphConnection;
4417
4418 /**
4419 * when reexported: with which priority
4420 */
4421 priority?: number;
4422
4423 /**
4424 * can the export be renamed (defaults to true)
4425 */
4426 canMangle?: boolean;
4427
4428 /**
4429 * are the exports terminal bindings that should be checked for export star conflicts
4430 */
4431 terminalBinding?: boolean;
4432
4433 /**
4434 * module on which the result depends on
4435 */
4436 dependencies?: Module[];
4437}
4438type Exposes = (string | ExposesObject)[] | ExposesObject;
4439
4440/**
4441 * Advanced configuration for modules that should be exposed by this container.
4442 */
4443declare interface ExposesConfig {
4444 /**
4445 * Request to a module that should be exposed by this container.
4446 */
4447 import: string | string[];
4448
4449 /**
4450 * Custom chunk name for the exposed module.
4451 */
4452 name?: string;
4453}
4454
4455/**
4456 * Modules that should be exposed by this container. Property names are used as public paths.
4457 */
4458declare interface ExposesObject {
4459 [index: string]: string | ExposesConfig | string[];
4460}
4461type Expression =
4462 | UnaryExpression
4463 | ArrayExpression
4464 | ArrowFunctionExpression
4465 | AssignmentExpression
4466 | AwaitExpression
4467 | BinaryExpression
4468 | SimpleCallExpression
4469 | NewExpression
4470 | ChainExpression
4471 | ClassExpression
4472 | ConditionalExpression
4473 | FunctionExpression
4474 | Identifier
4475 | ImportExpression
4476 | SimpleLiteral
4477 | RegExpLiteral
4478 | BigIntLiteral
4479 | LogicalExpression
4480 | MemberExpression
4481 | MetaProperty
4482 | ObjectExpression
4483 | SequenceExpression
4484 | TaggedTemplateExpression
4485 | TemplateLiteral
4486 | ThisExpression
4487 | UpdateExpression
4488 | YieldExpression;
4489declare interface ExpressionExpressionInfo {
4490 type: "expression";
4491 rootInfo: string | VariableInfo;
4492 name: string;
4493 getMembers: () => string[];
4494 getMembersOptionals: () => boolean[];
4495 getMemberRanges: () => [number, number][];
4496}
4497declare interface ExtensionAliasOption {
4498 alias: string | string[];
4499 extension: string;
4500}
4501declare interface ExtensionAliasOptions {
4502 [index: string]: string | string[];
4503}
4504type ExternalItem =
4505 | string
4506 | RegExp
4507 | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
4508 | ((
4509 data: ExternalItemFunctionData,
4510 callback: (
4511 err?: null | Error,
4512 result?: string | boolean | string[] | { [index: string]: any }
4513 ) => void
4514 ) => void)
4515 | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
4516
4517/**
4518 * Data object passed as argument when a function is set for 'externals'.
4519 */
4520declare interface ExternalItemFunctionData {
4521 /**
4522 * The directory in which the request is placed.
4523 */
4524 context?: string;
4525
4526 /**
4527 * Contextual information.
4528 */
4529 contextInfo?: ModuleFactoryCreateDataContextInfo;
4530
4531 /**
4532 * The category of the referencing dependencies.
4533 */
4534 dependencyType?: string;
4535
4536 /**
4537 * Get a resolve function with the current resolver options.
4538 */
4539 getResolve?: (
4540 options?: ResolveOptions
4541 ) =>
4542 | ((
4543 context: string,
4544 request: string,
4545 callback: (err?: Error, result?: string) => void
4546 ) => void)
4547 | ((context: string, request: string) => Promise<string>);
4548
4549 /**
4550 * The request as written by the user in the require/import expression/statement.
4551 */
4552 request?: string;
4553}
4554
4555/**
4556 * If an dependency matches exactly a property of the object, the property value is used as dependency.
4557 */
4558declare interface ExternalItemObjectKnown {
4559 /**
4560 * Specify externals depending on the layer.
4561 */
4562 byLayer?:
4563 | { [index: string]: ExternalItem }
4564 | ((layer: null | string) => ExternalItem);
4565}
4566
4567/**
4568 * If an dependency matches exactly a property of the object, the property value is used as dependency.
4569 */
4570declare interface ExternalItemObjectUnknown {
4571 [index: string]: ExternalItemValue;
4572}
4573type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
4574declare class ExternalModule extends Module {
4575 constructor(
4576 request: string | string[] | RequestRecord,
4577 type: string,
4578 userRequest: string,
4579 dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta
4580 );
4581 request: string | string[] | Record<string, string | string[]>;
4582 externalType: string;
4583 userRequest: string;
4584 dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta;
4585
4586 /**
4587 * restore unsafe cache data
4588 */
4589 restoreFromUnsafeCache(
4590 unsafeCacheData: object,
4591 normalModuleFactory: NormalModuleFactory
4592 ): void;
4593}
4594declare interface ExternalModuleInfo {
4595 index: number;
4596 module: Module;
4597}
4598type Externals =
4599 | string
4600 | RegExp
4601 | ExternalItem[]
4602 | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
4603 | ((
4604 data: ExternalItemFunctionData,
4605 callback: (
4606 err?: null | Error,
4607 result?: string | boolean | string[] | { [index: string]: any }
4608 ) => void
4609 ) => void)
4610 | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
4611declare class ExternalsPlugin {
4612 constructor(type: undefined | string, externals: Externals);
4613 type?: string;
4614 externals: Externals;
4615
4616 /**
4617 * Apply the plugin
4618 */
4619 apply(compiler: Compiler): void;
4620}
4621
4622/**
4623 * Enable presets of externals for specific targets.
4624 */
4625declare interface ExternalsPresets {
4626 /**
4627 * Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.
4628 */
4629 electron?: boolean;
4630
4631 /**
4632 * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
4633 */
4634 electronMain?: boolean;
4635
4636 /**
4637 * Treat electron built-in modules in the preload context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
4638 */
4639 electronPreload?: boolean;
4640
4641 /**
4642 * Treat electron built-in modules in the renderer context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
4643 */
4644 electronRenderer?: boolean;
4645
4646 /**
4647 * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
4648 */
4649 node?: boolean;
4650
4651 /**
4652 * Treat NW.js legacy nw.gui module as external and load it via require() when used.
4653 */
4654 nwjs?: boolean;
4655
4656 /**
4657 * Treat references to 'http(s)://...' and 'std:...' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).
4658 */
4659 web?: boolean;
4660
4661 /**
4662 * Treat references to 'http(s)://...' and 'std:...' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).
4663 */
4664 webAsync?: boolean;
4665}
4666type ExternalsType =
4667 | "import"
4668 | "var"
4669 | "module"
4670 | "assign"
4671 | "this"
4672 | "window"
4673 | "self"
4674 | "global"
4675 | "commonjs"
4676 | "commonjs2"
4677 | "commonjs-module"
4678 | "commonjs-static"
4679 | "amd"
4680 | "amd-require"
4681 | "umd"
4682 | "umd2"
4683 | "jsonp"
4684 | "system"
4685 | "promise"
4686 | "module-import"
4687 | "script"
4688 | "node-commonjs";
4689declare interface FSImplementation {
4690 open?: (...args: any[]) => any;
4691 close?: (...args: any[]) => any;
4692}
4693declare interface FactorizeModuleOptions {
4694 currentProfile: ModuleProfile;
4695 factory: ModuleFactory;
4696 dependencies: Dependency[];
4697
4698 /**
4699 * return full ModuleFactoryResult instead of only module
4700 */
4701 factoryResult?: boolean;
4702 originModule: null | Module;
4703 contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
4704 context?: string;
4705}
4706declare interface FactoryMeta {
4707 sideEffectFree?: boolean;
4708}
4709type FakeHook<T> = T & FakeHookMarker;
4710declare interface FakeHookMarker {}
4711declare interface FallbackCacheGroup {
4712 chunksFilter: (chunk: Chunk) => undefined | boolean;
4713 minSize: SplitChunksSizes;
4714 maxAsyncSize: SplitChunksSizes;
4715 maxInitialSize: SplitChunksSizes;
4716 automaticNameDelimiter: string;
4717}
4718declare class FetchCompileAsyncWasmPlugin {
4719 constructor();
4720
4721 /**
4722 * Apply the plugin
4723 */
4724 apply(compiler: Compiler): void;
4725}
4726declare class FetchCompileWasmPlugin {
4727 constructor(options?: FetchCompileWasmPluginOptions);
4728 options: FetchCompileWasmPluginOptions;
4729
4730 /**
4731 * Apply the plugin
4732 */
4733 apply(compiler: Compiler): void;
4734}
4735declare interface FetchCompileWasmPluginOptions {
4736 /**
4737 * mangle imports
4738 */
4739 mangleImports?: boolean;
4740}
4741
4742/**
4743 * Options object for persistent file-based caching.
4744 */
4745declare interface FileCacheOptions {
4746 /**
4747 * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
4748 */
4749 allowCollectingMemory?: boolean;
4750
4751 /**
4752 * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
4753 */
4754 buildDependencies?: { [index: string]: string[] };
4755
4756 /**
4757 * Base directory for the cache (defaults to node_modules/.cache/webpack).
4758 */
4759 cacheDirectory?: string;
4760
4761 /**
4762 * Locations for the cache (defaults to cacheDirectory / name).
4763 */
4764 cacheLocation?: string;
4765
4766 /**
4767 * Compression type used for the cache files.
4768 */
4769 compression?: false | "gzip" | "brotli";
4770
4771 /**
4772 * Algorithm used for generation the hash (see node.js crypto package).
4773 */
4774 hashAlgorithm?: string;
4775
4776 /**
4777 * Time in ms after which idle period the cache storing should happen.
4778 */
4779 idleTimeout?: number;
4780
4781 /**
4782 * Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).
4783 */
4784 idleTimeoutAfterLargeChanges?: number;
4785
4786 /**
4787 * Time in ms after which idle period the initial cache storing should happen.
4788 */
4789 idleTimeoutForInitialStore?: number;
4790
4791 /**
4792 * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
4793 */
4794 immutablePaths?: (string | RegExp)[];
4795
4796 /**
4797 * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
4798 */
4799 managedPaths?: (string | RegExp)[];
4800
4801 /**
4802 * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
4803 */
4804 maxAge?: number;
4805
4806 /**
4807 * Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.
4808 */
4809 maxMemoryGenerations?: number;
4810
4811 /**
4812 * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
4813 */
4814 memoryCacheUnaffected?: boolean;
4815
4816 /**
4817 * Name for the cache. Different names will lead to different coexisting caches.
4818 */
4819 name?: string;
4820
4821 /**
4822 * Track and log detailed timing information for individual cache items.
4823 */
4824 profile?: boolean;
4825
4826 /**
4827 * Enable/disable readonly mode.
4828 */
4829 readonly?: boolean;
4830
4831 /**
4832 * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
4833 */
4834 store?: "pack";
4835
4836 /**
4837 * Filesystem caching.
4838 */
4839 type: "filesystem";
4840
4841 /**
4842 * Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache.
4843 */
4844 version?: string;
4845}
4846declare interface FileSystem {
4847 readFile: ReadFileTypes;
4848 readdir: ReaddirTypes;
4849 readJson?: (
4850 arg0: PathOrFileDescriptorTypes,
4851 arg1: (
4852 arg0: null | Error | NodeJS.ErrnoException,
4853 arg1?: JsonObjectTypes
4854 ) => void
4855 ) => void;
4856 readlink: ReadlinkTypes;
4857 lstat?: LStatTypes;
4858 stat: StatTypes;
4859 realpath?: RealPathTypes;
4860}
4861declare abstract class FileSystemInfo {
4862 fs: InputFileSystem;
4863 logger?: WebpackLogger;
4864 fileTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
4865 fileHashQueue: AsyncQueue<string, string, string>;
4866 contextTimestampQueue: AsyncQueue<string, string, ContextFileSystemInfoEntry>;
4867 contextHashQueue: AsyncQueue<string, string, ContextHash>;
4868 contextTshQueue: AsyncQueue<string, string, ContextTimestampAndHash>;
4869 managedItemQueue: AsyncQueue<string, string, string>;
4870 managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
4871 unmanagedPathsWithSlash: string[];
4872 unmanagedPathsRegExps: RegExp[];
4873 managedPaths: (string | RegExp)[];
4874 managedPathsWithSlash: string[];
4875 managedPathsRegExps: RegExp[];
4876 immutablePaths: (string | RegExp)[];
4877 immutablePathsWithSlash: string[];
4878 immutablePathsRegExps: RegExp[];
4879 logStatistics(): void;
4880 clear(): void;
4881 addFileTimestamps(
4882 map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
4883 immutable?: boolean
4884 ): void;
4885 addContextTimestamps(
4886 map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
4887 immutable?: boolean
4888 ): void;
4889 getFileTimestamp(
4890 path: string,
4891 callback: (
4892 arg0?: null | WebpackError,
4893 arg1?: null | FileSystemInfoEntry | "ignore"
4894 ) => void
4895 ): void;
4896 getContextTimestamp(
4897 path: string,
4898 callback: (
4899 arg0?: null | WebpackError,
4900 arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
4901 ) => void
4902 ): void;
4903 getFileHash(
4904 path: string,
4905 callback: (arg0?: null | WebpackError, arg1?: null | string) => void
4906 ): void;
4907 getContextHash(
4908 path: string,
4909 callback: (arg0?: null | WebpackError, arg1?: string) => void
4910 ): void;
4911 getContextTsh(
4912 path: string,
4913 callback: (
4914 arg0?: null | WebpackError,
4915 arg1?: null | ResolvedContextTimestampAndHash
4916 ) => void
4917 ): void;
4918 resolveBuildDependencies(
4919 context: string,
4920 deps: Iterable<string>,
4921 callback: (
4922 arg0?: null | Error,
4923 arg1?: ResolveBuildDependenciesResult
4924 ) => void
4925 ): void;
4926 checkResolveResultsValid(
4927 resolveResults: Map<string, string | false>,
4928 callback: (arg0?: null | Error, arg1?: boolean) => void
4929 ): void;
4930 createSnapshot(
4931 startTime: undefined | null | number,
4932 files: null | Iterable<string>,
4933 directories: null | Iterable<string>,
4934 missing: null | Iterable<string>,
4935 options: undefined | null | SnapshotOptionsFileSystemInfo,
4936 callback: (arg0: null | WebpackError, arg1: null | Snapshot) => void
4937 ): void;
4938 mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
4939 checkSnapshotValid(
4940 snapshot: Snapshot,
4941 callback: (arg0?: null | WebpackError, arg1?: boolean) => void
4942 ): void;
4943 getDeprecatedFileTimestamps(): Map<any, any>;
4944 getDeprecatedContextTimestamps(): Map<any, any>;
4945}
4946declare interface FileSystemInfoEntry {
4947 safeTime: number;
4948 timestamp?: number;
4949}
4950type FilterItemTypes = string | RegExp | ((value: string) => boolean);
4951declare interface Flags {
4952 [index: string]: Argument;
4953}
4954declare interface GenerateContext {
4955 /**
4956 * mapping from dependencies to templates
4957 */
4958 dependencyTemplates: DependencyTemplates;
4959
4960 /**
4961 * the runtime template
4962 */
4963 runtimeTemplate: RuntimeTemplate;
4964
4965 /**
4966 * the module graph
4967 */
4968 moduleGraph: ModuleGraph;
4969
4970 /**
4971 * the chunk graph
4972 */
4973 chunkGraph: ChunkGraph;
4974
4975 /**
4976 * the requirements for runtime
4977 */
4978 runtimeRequirements: Set<string>;
4979
4980 /**
4981 * the runtime
4982 */
4983 runtime: RuntimeSpec;
4984
4985 /**
4986 * when in concatenated module, information about other concatenated modules
4987 */
4988 concatenationScope?: ConcatenationScope;
4989
4990 /**
4991 * code generation results of other modules (need to have a codeGenerationDependency to use that)
4992 */
4993 codeGenerationResults?: CodeGenerationResults;
4994
4995 /**
4996 * which kind of code should be generated
4997 */
4998 type: string;
4999
5000 /**
5001 * get access to the code generation data
5002 */
5003 getData?: () => Map<string, any>;
5004}
5005declare class Generator {
5006 constructor();
5007 getTypes(module: NormalModule): Set<string>;
5008 getSize(module: NormalModule, type?: string): number;
5009 generate(module: NormalModule, __1: GenerateContext): Source;
5010 getConcatenationBailoutReason(
5011 module: NormalModule,
5012 context: ConcatenationBailoutReasonContext
5013 ): undefined | string;
5014 updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
5015 static byType(map: Record<string, Generator>): ByTypeGenerator;
5016}
5017declare interface GeneratorOptions {
5018 [index: string]: any;
5019}
5020type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
5021 GeneratorOptionsByModuleTypeUnknown;
5022
5023/**
5024 * Specify options for each generator.
5025 */
5026declare interface GeneratorOptionsByModuleTypeKnown {
5027 /**
5028 * Generator options for asset modules.
5029 */
5030 asset?: AssetGeneratorOptions;
5031
5032 /**
5033 * Generator options for asset/inline modules.
5034 */
5035 "asset/inline"?: AssetInlineGeneratorOptions;
5036
5037 /**
5038 * Generator options for asset/resource modules.
5039 */
5040 "asset/resource"?: AssetResourceGeneratorOptions;
5041
5042 /**
5043 * Generator options for css modules.
5044 */
5045 css?: CssGeneratorOptions;
5046
5047 /**
5048 * Generator options for css/auto modules.
5049 */
5050 "css/auto"?: CssAutoGeneratorOptions;
5051
5052 /**
5053 * Generator options for css/global modules.
5054 */
5055 "css/global"?: CssGlobalGeneratorOptions;
5056
5057 /**
5058 * Generator options for css/module modules.
5059 */
5060 "css/module"?: CssModuleGeneratorOptions;
5061
5062 /**
5063 * No generator options are supported for this module type.
5064 */
5065 javascript?: EmptyGeneratorOptions;
5066
5067 /**
5068 * No generator options are supported for this module type.
5069 */
5070 "javascript/auto"?: EmptyGeneratorOptions;
5071
5072 /**
5073 * No generator options are supported for this module type.
5074 */
5075 "javascript/dynamic"?: EmptyGeneratorOptions;
5076
5077 /**
5078 * No generator options are supported for this module type.
5079 */
5080 "javascript/esm"?: EmptyGeneratorOptions;
5081}
5082
5083/**
5084 * Specify options for each generator.
5085 */
5086declare interface GeneratorOptionsByModuleTypeUnknown {
5087 [index: string]: { [index: string]: any };
5088}
5089declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
5090 constructor(
5091 contentType: string,
5092 name: string,
5093 global: string,
5094 getFilenameForChunk: (arg0: Chunk) => TemplatePath,
5095 allChunks: boolean
5096 );
5097 contentType: string;
5098 global: string;
5099 getFilenameForChunk: (arg0: Chunk) => TemplatePath;
5100 allChunks: boolean;
5101
5102 /**
5103 * Runtime modules without any dependencies to other runtime modules
5104 */
5105 static STAGE_NORMAL: number;
5106
5107 /**
5108 * Runtime modules with simple dependencies on other runtime modules
5109 */
5110 static STAGE_BASIC: number;
5111
5112 /**
5113 * Runtime modules which attach to handlers of other runtime modules
5114 */
5115 static STAGE_ATTACH: number;
5116
5117 /**
5118 * Runtime modules which trigger actions on bootstrap
5119 */
5120 static STAGE_TRIGGER: number;
5121}
5122declare interface GroupConfig {
5123 getKeys: (arg0?: any) => undefined | string[];
5124 createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
5125 getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
5126}
5127declare interface GroupOptions {
5128 groupChildren?: boolean;
5129 force?: boolean;
5130 targetGroupCount?: number;
5131}
5132declare interface HMRJavascriptParserHooks {
5133 hotAcceptCallback: SyncBailHook<[any, string[]], void>;
5134 hotAcceptWithoutCallback: SyncBailHook<[any, string[]], void>;
5135}
5136declare interface HandleModuleCreationOptions {
5137 factory: ModuleFactory;
5138 dependencies: Dependency[];
5139 originModule: null | Module;
5140 contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
5141 context?: string;
5142
5143 /**
5144 * recurse into dependencies of the created module
5145 */
5146 recursive?: boolean;
5147
5148 /**
5149 * connect the resolved module with the origin module
5150 */
5151 connectOrigin?: boolean;
5152
5153 /**
5154 * check the cycle dependencies of the created module
5155 */
5156 checkCycle?: boolean;
5157}
5158declare class HarmonyImportDependency extends ModuleDependency {
5159 constructor(
5160 request: string,
5161 sourceOrder: number,
5162 attributes?: ImportAttributes
5163 );
5164 sourceOrder: number;
5165 getImportVar(moduleGraph: ModuleGraph): string;
5166 getImportStatement(
5167 update: boolean,
5168 __1: DependencyTemplateContext
5169 ): [string, string];
5170 getLinkingErrors(
5171 moduleGraph: ModuleGraph,
5172 ids: string[],
5173 additionalMessage: string
5174 ): undefined | WebpackError[];
5175 static Template: typeof HarmonyImportDependencyTemplate;
5176 static ExportPresenceModes: {
5177 NONE: 0;
5178 WARN: 1;
5179 AUTO: 2;
5180 ERROR: 3;
5181 fromUserOption(str: string | false): 0 | 1 | 2 | 3;
5182 };
5183 static NO_EXPORTS_REFERENCED: string[][];
5184 static EXPORTS_OBJECT_REFERENCED: string[][];
5185 static TRANSITIVE: typeof TRANSITIVE;
5186}
5187declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
5188 constructor();
5189 static getImportEmittedRuntime(
5190 module: Module,
5191 referencedModule: Module
5192 ): undefined | string | boolean | SortableSet<string>;
5193}
5194declare class Hash {
5195 constructor();
5196
5197 /**
5198 * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
5199 */
5200 update(data: string | Buffer, inputEncoding?: string): Hash;
5201
5202 /**
5203 * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
5204 */
5205 digest(encoding?: string): string | Buffer;
5206}
5207type HashFunction = string | typeof Hash;
5208declare interface HashableObject {
5209 updateHash: (arg0: Hash) => void;
5210}
5211declare class HashedModuleIdsPlugin {
5212 constructor(options?: HashedModuleIdsPluginOptions);
5213 options: HashedModuleIdsPluginOptions;
5214
5215 /**
5216 * Apply the plugin
5217 */
5218 apply(compiler: Compiler): void;
5219}
5220declare interface HashedModuleIdsPluginOptions {
5221 /**
5222 * The context directory for creating names.
5223 */
5224 context?: string;
5225
5226 /**
5227 * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
5228 */
5229 hashDigest?: "latin1" | "base64" | "hex";
5230
5231 /**
5232 * The prefix length of the hash digest to use, defaults to 4.
5233 */
5234 hashDigestLength?: number;
5235
5236 /**
5237 * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
5238 */
5239 hashFunction?: string | typeof Hash;
5240}
5241declare abstract class HelperRuntimeModule extends RuntimeModule {}
5242declare class HotModuleReplacementPlugin {
5243 constructor(options?: object);
5244 options: object;
5245
5246 /**
5247 * Apply the plugin
5248 */
5249 apply(compiler: Compiler): void;
5250 static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
5251}
5252
5253/**
5254 * These properties are added by the HotModuleReplacementPlugin
5255 */
5256declare interface HotModuleReplacementPluginLoaderContext {
5257 hot?: boolean;
5258}
5259declare class HotUpdateChunk extends Chunk {
5260 constructor();
5261}
5262
5263/**
5264 * Options for building http resources.
5265 */
5266declare interface HttpUriOptions {
5267 /**
5268 * List of allowed URIs (resp. the beginning of them).
5269 */
5270 allowedUris: (string | RegExp | ((uri: string) => boolean))[];
5271
5272 /**
5273 * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
5274 */
5275 cacheLocation?: string | false;
5276
5277 /**
5278 * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
5279 */
5280 frozen?: boolean;
5281
5282 /**
5283 * Location of the lockfile.
5284 */
5285 lockfileLocation?: string;
5286
5287 /**
5288 * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
5289 */
5290 proxy?: string;
5291
5292 /**
5293 * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
5294 */
5295 upgrade?: boolean;
5296}
5297declare class HttpUriPlugin {
5298 constructor(options: HttpUriOptions);
5299
5300 /**
5301 * Apply the plugin
5302 */
5303 apply(compiler: Compiler): void;
5304}
5305type IBigIntStats = IStatsBase<bigint> & {
5306 atimeNs: bigint;
5307 mtimeNs: bigint;
5308 ctimeNs: bigint;
5309 birthtimeNs: bigint;
5310};
5311declare interface IStats {
5312 isFile: () => boolean;
5313 isDirectory: () => boolean;
5314 isBlockDevice: () => boolean;
5315 isCharacterDevice: () => boolean;
5316 isSymbolicLink: () => boolean;
5317 isFIFO: () => boolean;
5318 isSocket: () => boolean;
5319 dev: number;
5320 ino: number;
5321 mode: number;
5322 nlink: number;
5323 uid: number;
5324 gid: number;
5325 rdev: number;
5326 size: number;
5327 blksize: number;
5328 blocks: number;
5329 atimeMs: number;
5330 mtimeMs: number;
5331 ctimeMs: number;
5332 birthtimeMs: number;
5333 atime: Date;
5334 mtime: Date;
5335 ctime: Date;
5336 birthtime: Date;
5337}
5338declare interface IStatsBase<T> {
5339 isFile: () => boolean;
5340 isDirectory: () => boolean;
5341 isBlockDevice: () => boolean;
5342 isCharacterDevice: () => boolean;
5343 isSymbolicLink: () => boolean;
5344 isFIFO: () => boolean;
5345 isSocket: () => boolean;
5346 dev: T;
5347 ino: T;
5348 mode: T;
5349 nlink: T;
5350 uid: T;
5351 gid: T;
5352 rdev: T;
5353 size: T;
5354 blksize: T;
5355 blocks: T;
5356 atimeMs: T;
5357 mtimeMs: T;
5358 ctimeMs: T;
5359 birthtimeMs: T;
5360 atime: Date;
5361 mtime: Date;
5362 ctime: Date;
5363 birthtime: Date;
5364}
5365declare class IgnorePlugin {
5366 constructor(options: IgnorePluginOptions);
5367 options: IgnorePluginOptions;
5368
5369 /**
5370 * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
5371 */
5372 checkIgnore(resolveData: ResolveData): undefined | false;
5373
5374 /**
5375 * Apply the plugin
5376 */
5377 apply(compiler: Compiler): void;
5378}
5379type IgnorePluginOptions =
5380 | {
5381 /**
5382 * A RegExp to test the context (directory) against.
5383 */
5384 contextRegExp?: RegExp;
5385 /**
5386 * A RegExp to test the request against.
5387 */
5388 resourceRegExp: RegExp;
5389 }
5390 | {
5391 /**
5392 * A filter function for resource and context.
5393 */
5394 checkResource: (resource: string, context: string) => boolean;
5395 };
5396type ImportAttributes = Record<string, string> & {};
5397declare interface ImportDependencyMeta {
5398 attributes?: ImportAttributes;
5399 externalType?: "import" | "module";
5400}
5401declare interface ImportModuleOptions {
5402 /**
5403 * the target layer
5404 */
5405 layer?: string;
5406
5407 /**
5408 * the target public path
5409 */
5410 publicPath?: string;
5411
5412 /**
5413 * target base uri
5414 */
5415 baseUri?: string;
5416}
5417type ImportSource =
5418 | undefined
5419 | null
5420 | string
5421 | SimpleLiteral
5422 | RegExpLiteral
5423 | BigIntLiteral;
5424
5425/**
5426 * Options for infrastructure level logging.
5427 */
5428declare interface InfrastructureLogging {
5429 /**
5430 * Only appends lines to the output. Avoids updating existing output e. g. for status messages. This option is only used when no custom console is provided.
5431 */
5432 appendOnly?: boolean;
5433
5434 /**
5435 * Enables/Disables colorful output. This option is only used when no custom console is provided.
5436 */
5437 colors?: boolean;
5438
5439 /**
5440 * Custom console used for logging.
5441 */
5442 console?: Console;
5443
5444 /**
5445 * Enable debug logging for specific loggers.
5446 */
5447 debug?:
5448 | string
5449 | boolean
5450 | RegExp
5451 | FilterItemTypes[]
5452 | ((value: string) => boolean);
5453
5454 /**
5455 * Log level.
5456 */
5457 level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
5458
5459 /**
5460 * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
5461 */
5462 stream?: NodeJS.WritableStream;
5463}
5464declare class InitFragment<GenerateContext> {
5465 constructor(
5466 content: undefined | string | Source,
5467 stage: number,
5468 position: number,
5469 key?: string,
5470 endContent?: string | Source
5471 );
5472 content?: string | Source;
5473 stage: number;
5474 position: number;
5475 key?: string;
5476 endContent?: string | Source;
5477 getContent(context: GenerateContext): undefined | string | Source;
5478 getEndContent(context: GenerateContext): undefined | string | Source;
5479 serialize(context: ObjectSerializerContext): void;
5480 deserialize(context: ObjectDeserializerContext): void;
5481 merge: any;
5482 static addToSource<Context, T>(
5483 source: Source,
5484 initFragments: InitFragment<T>[],
5485 context: Context
5486 ): Source;
5487 static STAGE_CONSTANTS: number;
5488 static STAGE_ASYNC_BOUNDARY: number;
5489 static STAGE_HARMONY_EXPORTS: number;
5490 static STAGE_HARMONY_IMPORTS: number;
5491 static STAGE_PROVIDES: number;
5492 static STAGE_ASYNC_DEPENDENCIES: number;
5493 static STAGE_ASYNC_HARMONY_IMPORTS: number;
5494}
5495declare interface InputFileSystem {
5496 readFile: ReadFileFs;
5497 readFileSync?: ReadFileSync;
5498 readlink: ReadlinkFs;
5499 readlinkSync?: ReadlinkSync;
5500 readdir: ReaddirFs;
5501 readdirSync?: ReaddirSync;
5502 stat: StatFs;
5503 statSync?: StatSync;
5504 lstat?: LStatFs;
5505 lstatSync?: LStatSync;
5506 realpath?: RealPathFs;
5507 realpathSync?: RealPathSync;
5508 readJson?: (
5509 arg0: PathOrFileDescriptorFs,
5510 arg1: (
5511 arg0: null | Error | NodeJS.ErrnoException,
5512 arg1?: JsonObjectFs
5513 ) => void
5514 ) => void;
5515 readJsonSync?: (arg0: PathOrFileDescriptorFs) => JsonObjectFs;
5516 purge?: (arg0?: string | string[] | Set<string>) => void;
5517 join?: (arg0: string, arg1: string) => string;
5518 relative?: (arg0: string, arg1: string) => string;
5519 dirname?: (arg0: string) => string;
5520}
5521type IntermediateFileSystem = InputFileSystem &
5522 OutputFileSystem &
5523 IntermediateFileSystemExtras;
5524declare interface IntermediateFileSystemExtras {
5525 mkdirSync: MkdirSync;
5526 createWriteStream: (
5527 arg0: PathLikeFs,
5528 arg1?:
5529 | "ascii"
5530 | "utf8"
5531 | "utf-8"
5532 | "utf16le"
5533 | "utf-16le"
5534 | "ucs2"
5535 | "ucs-2"
5536 | "latin1"
5537 | "binary"
5538 | "base64"
5539 | "base64url"
5540 | "hex"
5541 | WriteStreamOptions
5542 ) => NodeJS.WritableStream;
5543 open: Open;
5544 read: Read<Buffer>;
5545 close: (
5546 arg0: number,
5547 arg1: (arg0: null | NodeJS.ErrnoException) => void
5548 ) => void;
5549 rename: (
5550 arg0: PathLikeFs,
5551 arg1: PathLikeFs,
5552 arg2: (arg0: null | NodeJS.ErrnoException) => void
5553 ) => void;
5554}
5555type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
5556declare interface InterpolatedPathAndAssetInfo {
5557 path: string;
5558 info: AssetInfo;
5559}
5560declare interface Item<T> {
5561 [index: string]: string | string[] | T;
5562}
5563declare abstract class ItemCacheFacade {
5564 get<T>(callback: CallbackCacheCacheFacade<T>): void;
5565 getPromise<T>(): Promise<T>;
5566 store<T>(data: T, callback: CallbackCacheCacheFacade<void>): void;
5567 storePromise<T>(data: T): Promise<void>;
5568 provide<T>(
5569 computer: (arg0: CallbackNormalErrorCache<T>) => void,
5570 callback: CallbackNormalErrorCache<T>
5571 ): void;
5572 providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
5573}
5574declare class JavascriptModulesPlugin {
5575 constructor(options?: object);
5576 options: object;
5577
5578 /**
5579 * Apply the plugin
5580 */
5581 apply(compiler: Compiler): void;
5582 renderModule(
5583 module: Module,
5584 renderContext: ChunkRenderContext,
5585 hooks: CompilationHooksJavascriptModulesPlugin,
5586 factory: boolean
5587 ): null | Source;
5588 renderChunk(
5589 renderContext: RenderContext,
5590 hooks: CompilationHooksJavascriptModulesPlugin
5591 ): Source;
5592 renderMain(
5593 renderContext: MainRenderContext,
5594 hooks: CompilationHooksJavascriptModulesPlugin,
5595 compilation: Compilation
5596 ): Source;
5597 updateHashWithBootstrap(
5598 hash: Hash,
5599 renderContext: RenderBootstrapContext,
5600 hooks: CompilationHooksJavascriptModulesPlugin
5601 ): void;
5602 renderBootstrap(
5603 renderContext: RenderBootstrapContext,
5604 hooks: CompilationHooksJavascriptModulesPlugin
5605 ): Bootstrap;
5606 renderRequire(
5607 renderContext: RenderBootstrapContext,
5608 hooks: CompilationHooksJavascriptModulesPlugin
5609 ): string;
5610 getRenamedInlineModule(
5611 allModules: Module[],
5612 renderContext: MainRenderContext,
5613 inlinedModules: Set<Module>,
5614 chunkRenderContext: ChunkRenderContext,
5615 hooks: CompilationHooksJavascriptModulesPlugin,
5616 allStrict: boolean,
5617 hasChunkModules: boolean
5618 ): false | Map<Module, Source>;
5619 findNewName(
5620 oldName: string,
5621 usedName: Set<string>,
5622 extraInfo: string
5623 ): string;
5624 static getCompilationHooks(
5625 compilation: Compilation
5626 ): CompilationHooksJavascriptModulesPlugin;
5627 static getChunkFilenameTemplate(
5628 chunk: Chunk,
5629 outputOptions: Output
5630 ): TemplatePath;
5631 static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
5632}
5633declare class JavascriptParser extends Parser {
5634 constructor(sourceType?: "module" | "auto" | "script");
5635 hooks: Readonly<{
5636 evaluateTypeof: HookMap<
5637 SyncBailHook<
5638 [UnaryExpression],
5639 undefined | null | BasicEvaluatedExpression
5640 >
5641 >;
5642 evaluate: HookMap<
5643 SyncBailHook<
5644 [
5645 | UnaryExpression
5646 | ArrayExpression
5647 | ArrowFunctionExpression
5648 | AssignmentExpression
5649 | AwaitExpression
5650 | BinaryExpression
5651 | SimpleCallExpression
5652 | NewExpression
5653 | ChainExpression
5654 | ClassExpression
5655 | ConditionalExpression
5656 | FunctionExpression
5657 | Identifier
5658 | ImportExpression
5659 | SimpleLiteral
5660 | RegExpLiteral
5661 | BigIntLiteral
5662 | LogicalExpression
5663 | MemberExpression
5664 | MetaProperty
5665 | ObjectExpression
5666 | SequenceExpression
5667 | TaggedTemplateExpression
5668 | TemplateLiteral
5669 | ThisExpression
5670 | UpdateExpression
5671 | YieldExpression
5672 | SpreadElement
5673 ],
5674 undefined | null | BasicEvaluatedExpression
5675 >
5676 >;
5677 evaluateIdentifier: HookMap<
5678 SyncBailHook<
5679 [Identifier | MemberExpression | MetaProperty | ThisExpression],
5680 undefined | null | BasicEvaluatedExpression
5681 >
5682 >;
5683 evaluateDefinedIdentifier: HookMap<
5684 SyncBailHook<
5685 [Identifier | MemberExpression | ThisExpression],
5686 undefined | null | BasicEvaluatedExpression
5687 >
5688 >;
5689 evaluateNewExpression: HookMap<
5690 SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
5691 >;
5692 evaluateCallExpression: HookMap<
5693 SyncBailHook<
5694 [CallExpression],
5695 undefined | null | BasicEvaluatedExpression
5696 >
5697 >;
5698 evaluateCallExpressionMember: HookMap<
5699 SyncBailHook<
5700 [CallExpression, BasicEvaluatedExpression],
5701 undefined | null | BasicEvaluatedExpression
5702 >
5703 >;
5704 isPure: HookMap<
5705 SyncBailHook<
5706 [
5707 (
5708 | UnaryExpression
5709 | ArrayExpression
5710 | ArrowFunctionExpression
5711 | AssignmentExpression
5712 | AwaitExpression
5713 | BinaryExpression
5714 | SimpleCallExpression
5715 | NewExpression
5716 | ChainExpression
5717 | ClassExpression
5718 | ConditionalExpression
5719 | FunctionExpression
5720 | Identifier
5721 | ImportExpression
5722 | SimpleLiteral
5723 | RegExpLiteral
5724 | BigIntLiteral
5725 | LogicalExpression
5726 | MemberExpression
5727 | MetaProperty
5728 | ObjectExpression
5729 | SequenceExpression
5730 | TaggedTemplateExpression
5731 | TemplateLiteral
5732 | ThisExpression
5733 | UpdateExpression
5734 | YieldExpression
5735 | FunctionDeclaration
5736 | VariableDeclaration
5737 | ClassDeclaration
5738 | PrivateIdentifier
5739 ),
5740 number
5741 ],
5742 boolean | void
5743 >
5744 >;
5745 preStatement: SyncBailHook<
5746 [
5747 | FunctionDeclaration
5748 | VariableDeclaration
5749 | ClassDeclaration
5750 | ExpressionStatement
5751 | BlockStatement
5752 | StaticBlock
5753 | EmptyStatement
5754 | DebuggerStatement
5755 | WithStatement
5756 | ReturnStatement
5757 | LabeledStatement
5758 | BreakStatement
5759 | ContinueStatement
5760 | IfStatement
5761 | SwitchStatement
5762 | ThrowStatement
5763 | TryStatement
5764 | WhileStatement
5765 | DoWhileStatement
5766 | ForStatement
5767 | ForInStatement
5768 | ForOfStatement
5769 | ImportDeclaration
5770 | ExportNamedDeclaration
5771 | ExportDefaultDeclaration
5772 | ExportAllDeclaration
5773 ],
5774 boolean | void
5775 >;
5776 blockPreStatement: SyncBailHook<
5777 [
5778 | FunctionDeclaration
5779 | VariableDeclaration
5780 | ClassDeclaration
5781 | ExpressionStatement
5782 | BlockStatement
5783 | StaticBlock
5784 | EmptyStatement
5785 | DebuggerStatement
5786 | WithStatement
5787 | ReturnStatement
5788 | LabeledStatement
5789 | BreakStatement
5790 | ContinueStatement
5791 | IfStatement
5792 | SwitchStatement
5793 | ThrowStatement
5794 | TryStatement
5795 | WhileStatement
5796 | DoWhileStatement
5797 | ForStatement
5798 | ForInStatement
5799 | ForOfStatement
5800 | ImportDeclaration
5801 | ExportNamedDeclaration
5802 | ExportDefaultDeclaration
5803 | ExportAllDeclaration
5804 ],
5805 boolean | void
5806 >;
5807 statement: SyncBailHook<
5808 [
5809 | FunctionDeclaration
5810 | VariableDeclaration
5811 | ClassDeclaration
5812 | ExpressionStatement
5813 | BlockStatement
5814 | StaticBlock
5815 | EmptyStatement
5816 | DebuggerStatement
5817 | WithStatement
5818 | ReturnStatement
5819 | LabeledStatement
5820 | BreakStatement
5821 | ContinueStatement
5822 | IfStatement
5823 | SwitchStatement
5824 | ThrowStatement
5825 | TryStatement
5826 | WhileStatement
5827 | DoWhileStatement
5828 | ForStatement
5829 | ForInStatement
5830 | ForOfStatement
5831 | ImportDeclaration
5832 | ExportNamedDeclaration
5833 | ExportDefaultDeclaration
5834 | ExportAllDeclaration
5835 ],
5836 boolean | void
5837 >;
5838 statementIf: SyncBailHook<[IfStatement], boolean | void>;
5839 classExtendsExpression: SyncBailHook<
5840 [Expression, ClassExpression | ClassDeclaration],
5841 boolean | void
5842 >;
5843 classBodyElement: SyncBailHook<
5844 [
5845 StaticBlock | MethodDefinition | PropertyDefinition,
5846 ClassExpression | ClassDeclaration
5847 ],
5848 boolean | void
5849 >;
5850 classBodyValue: SyncBailHook<
5851 [
5852 Expression,
5853 MethodDefinition | PropertyDefinition,
5854 ClassExpression | ClassDeclaration
5855 ],
5856 boolean | void
5857 >;
5858 label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
5859 import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
5860 importSpecifier: SyncBailHook<
5861 [ImportDeclaration, ImportSource, string, string],
5862 boolean | void
5863 >;
5864 export: SyncBailHook<
5865 [ExportNamedDeclaration | ExportDefaultDeclaration],
5866 boolean | void
5867 >;
5868 exportImport: SyncBailHook<
5869 [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
5870 boolean | void
5871 >;
5872 exportDeclaration: SyncBailHook<
5873 [
5874 (
5875 | ExportNamedDeclaration
5876 | ExportDefaultDeclaration
5877 | ExportAllDeclaration
5878 ),
5879 Declaration
5880 ],
5881 boolean | void
5882 >;
5883 exportExpression: SyncBailHook<
5884 [ExportDefaultDeclaration, FunctionDeclaration | ClassDeclaration],
5885 boolean | void
5886 >;
5887 exportSpecifier: SyncBailHook<
5888 [
5889 (
5890 | ExportNamedDeclaration
5891 | ExportDefaultDeclaration
5892 | ExportAllDeclaration
5893 ),
5894 string,
5895 string,
5896 undefined | number
5897 ],
5898 boolean | void
5899 >;
5900 exportImportSpecifier: SyncBailHook<
5901 [
5902 ExportNamedDeclaration | ExportAllDeclaration,
5903 ImportSource,
5904 string,
5905 string,
5906 undefined | number
5907 ],
5908 boolean | void
5909 >;
5910 preDeclarator: SyncBailHook<
5911 [VariableDeclarator, Statement],
5912 boolean | void
5913 >;
5914 declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
5915 varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
5916 varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
5917 varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
5918 varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
5919 pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
5920 canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
5921 rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
5922 assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
5923 assignMemberChain: HookMap<
5924 SyncBailHook<[AssignmentExpression, string[]], boolean | void>
5925 >;
5926 typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
5927 importCall: SyncBailHook<[ImportExpression], boolean | void>;
5928 topLevelAwait: SyncBailHook<
5929 [
5930 | UnaryExpression
5931 | ArrayExpression
5932 | ArrowFunctionExpression
5933 | AssignmentExpression
5934 | AwaitExpression
5935 | BinaryExpression
5936 | SimpleCallExpression
5937 | NewExpression
5938 | ChainExpression
5939 | ClassExpression
5940 | ConditionalExpression
5941 | FunctionExpression
5942 | Identifier
5943 | ImportExpression
5944 | SimpleLiteral
5945 | RegExpLiteral
5946 | BigIntLiteral
5947 | LogicalExpression
5948 | MemberExpression
5949 | MetaProperty
5950 | ObjectExpression
5951 | SequenceExpression
5952 | TaggedTemplateExpression
5953 | TemplateLiteral
5954 | ThisExpression
5955 | UpdateExpression
5956 | YieldExpression
5957 | ForOfStatement
5958 ],
5959 boolean | void
5960 >;
5961 call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
5962 callMemberChain: HookMap<
5963 SyncBailHook<
5964 [CallExpression, string[], boolean[], [number, number][]],
5965 boolean | void
5966 >
5967 >;
5968 memberChainOfCallMemberChain: HookMap<
5969 SyncBailHook<
5970 [Expression, string[], CallExpression, string[], [number, number][]],
5971 boolean | void
5972 >
5973 >;
5974 callMemberChainOfCallMemberChain: HookMap<
5975 SyncBailHook<
5976 [
5977 CallExpression,
5978 string[],
5979 CallExpression,
5980 string[],
5981 [number, number][]
5982 ],
5983 boolean | void
5984 >
5985 >;
5986 optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
5987 new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
5988 binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
5989 expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
5990 expressionMemberChain: HookMap<
5991 SyncBailHook<
5992 [MemberExpression, string[], boolean[], [number, number][]],
5993 boolean | void
5994 >
5995 >;
5996 unhandledExpressionMemberChain: HookMap<
5997 SyncBailHook<[MemberExpression, string[]], boolean | void>
5998 >;
5999 expressionConditionalOperator: SyncBailHook<
6000 [ConditionalExpression],
6001 boolean | void
6002 >;
6003 expressionLogicalOperator: SyncBailHook<
6004 [LogicalExpression],
6005 boolean | void
6006 >;
6007 program: SyncBailHook<[Program, Comment[]], boolean | void>;
6008 finish: SyncBailHook<[Program, Comment[]], boolean | void>;
6009 }>;
6010 sourceType: "module" | "auto" | "script";
6011 scope: ScopeInfo;
6012 state: ParserState;
6013 comments?: Comment[];
6014 semicolons?: Set<number>;
6015 statementPath: StatementPathItem[];
6016 prevStatement?:
6017 | UnaryExpression
6018 | ArrayExpression
6019 | ArrowFunctionExpression
6020 | AssignmentExpression
6021 | AwaitExpression
6022 | BinaryExpression
6023 | SimpleCallExpression
6024 | NewExpression
6025 | ChainExpression
6026 | ClassExpression
6027 | ConditionalExpression
6028 | FunctionExpression
6029 | Identifier
6030 | ImportExpression
6031 | SimpleLiteral
6032 | RegExpLiteral
6033 | BigIntLiteral
6034 | LogicalExpression
6035 | MemberExpression
6036 | MetaProperty
6037 | ObjectExpression
6038 | SequenceExpression
6039 | TaggedTemplateExpression
6040 | TemplateLiteral
6041 | ThisExpression
6042 | UpdateExpression
6043 | YieldExpression
6044 | FunctionDeclaration
6045 | VariableDeclaration
6046 | ClassDeclaration
6047 | ExpressionStatement
6048 | BlockStatement
6049 | StaticBlock
6050 | EmptyStatement
6051 | DebuggerStatement
6052 | WithStatement
6053 | ReturnStatement
6054 | LabeledStatement
6055 | BreakStatement
6056 | ContinueStatement
6057 | IfStatement
6058 | SwitchStatement
6059 | ThrowStatement
6060 | TryStatement
6061 | WhileStatement
6062 | DoWhileStatement
6063 | ForStatement
6064 | ForInStatement
6065 | ForOfStatement
6066 | ImportDeclaration
6067 | ExportNamedDeclaration
6068 | ExportDefaultDeclaration
6069 | ExportAllDeclaration;
6070 destructuringAssignmentProperties?: WeakMap<
6071 Expression,
6072 Set<DestructuringAssignmentProperty>
6073 >;
6074 currentTagData: any;
6075 magicCommentContext: Context;
6076 destructuringAssignmentPropertiesFor(
6077 node: Expression
6078 ): undefined | Set<DestructuringAssignmentProperty>;
6079 getRenameIdentifier(
6080 expr: Expression
6081 ): undefined | string | VariableInfoInterface;
6082 walkClass(classy: ClassExpression | ClassDeclaration): void;
6083
6084 /**
6085 * Pre walking iterates the scope for variable declarations
6086 */
6087 preWalkStatements(
6088 statements: (
6089 | FunctionDeclaration
6090 | VariableDeclaration
6091 | ClassDeclaration
6092 | ExpressionStatement
6093 | BlockStatement
6094 | StaticBlock
6095 | EmptyStatement
6096 | DebuggerStatement
6097 | WithStatement
6098 | ReturnStatement
6099 | LabeledStatement
6100 | BreakStatement
6101 | ContinueStatement
6102 | IfStatement
6103 | SwitchStatement
6104 | ThrowStatement
6105 | TryStatement
6106 | WhileStatement
6107 | DoWhileStatement
6108 | ForStatement
6109 | ForInStatement
6110 | ForOfStatement
6111 | ImportDeclaration
6112 | ExportNamedDeclaration
6113 | ExportDefaultDeclaration
6114 | ExportAllDeclaration
6115 )[]
6116 ): void;
6117
6118 /**
6119 * Block pre walking iterates the scope for block variable declarations
6120 */
6121 blockPreWalkStatements(
6122 statements: (
6123 | FunctionDeclaration
6124 | VariableDeclaration
6125 | ClassDeclaration
6126 | ExpressionStatement
6127 | BlockStatement
6128 | StaticBlock
6129 | EmptyStatement
6130 | DebuggerStatement
6131 | WithStatement
6132 | ReturnStatement
6133 | LabeledStatement
6134 | BreakStatement
6135 | ContinueStatement
6136 | IfStatement
6137 | SwitchStatement
6138 | ThrowStatement
6139 | TryStatement
6140 | WhileStatement
6141 | DoWhileStatement
6142 | ForStatement
6143 | ForInStatement
6144 | ForOfStatement
6145 | ImportDeclaration
6146 | ExportNamedDeclaration
6147 | ExportDefaultDeclaration
6148 | ExportAllDeclaration
6149 )[]
6150 ): void;
6151
6152 /**
6153 * Walking iterates the statements and expressions and processes them
6154 */
6155 walkStatements(
6156 statements: (
6157 | FunctionDeclaration
6158 | VariableDeclaration
6159 | ClassDeclaration
6160 | ExpressionStatement
6161 | BlockStatement
6162 | StaticBlock
6163 | EmptyStatement
6164 | DebuggerStatement
6165 | WithStatement
6166 | ReturnStatement
6167 | LabeledStatement
6168 | BreakStatement
6169 | ContinueStatement
6170 | IfStatement
6171 | SwitchStatement
6172 | ThrowStatement
6173 | TryStatement
6174 | WhileStatement
6175 | DoWhileStatement
6176 | ForStatement
6177 | ForInStatement
6178 | ForOfStatement
6179 | ImportDeclaration
6180 | ExportNamedDeclaration
6181 | ExportDefaultDeclaration
6182 | ExportAllDeclaration
6183 )[]
6184 ): void;
6185
6186 /**
6187 * Walking iterates the statements and expressions and processes them
6188 */
6189 preWalkStatement(
6190 statement:
6191 | FunctionDeclaration
6192 | VariableDeclaration
6193 | ClassDeclaration
6194 | ExpressionStatement
6195 | BlockStatement
6196 | StaticBlock
6197 | EmptyStatement
6198 | DebuggerStatement
6199 | WithStatement
6200 | ReturnStatement
6201 | LabeledStatement
6202 | BreakStatement
6203 | ContinueStatement
6204 | IfStatement
6205 | SwitchStatement
6206 | ThrowStatement
6207 | TryStatement
6208 | WhileStatement
6209 | DoWhileStatement
6210 | ForStatement
6211 | ForInStatement
6212 | ForOfStatement
6213 | ImportDeclaration
6214 | ExportNamedDeclaration
6215 | ExportDefaultDeclaration
6216 | ExportAllDeclaration
6217 ): void;
6218 blockPreWalkStatement(
6219 statement:
6220 | FunctionDeclaration
6221 | VariableDeclaration
6222 | ClassDeclaration
6223 | ExpressionStatement
6224 | BlockStatement
6225 | StaticBlock
6226 | EmptyStatement
6227 | DebuggerStatement
6228 | WithStatement
6229 | ReturnStatement
6230 | LabeledStatement
6231 | BreakStatement
6232 | ContinueStatement
6233 | IfStatement
6234 | SwitchStatement
6235 | ThrowStatement
6236 | TryStatement
6237 | WhileStatement
6238 | DoWhileStatement
6239 | ForStatement
6240 | ForInStatement
6241 | ForOfStatement
6242 | ImportDeclaration
6243 | ExportNamedDeclaration
6244 | ExportDefaultDeclaration
6245 | ExportAllDeclaration
6246 ): void;
6247 walkStatement(
6248 statement:
6249 | FunctionDeclaration
6250 | VariableDeclaration
6251 | ClassDeclaration
6252 | ExpressionStatement
6253 | BlockStatement
6254 | StaticBlock
6255 | EmptyStatement
6256 | DebuggerStatement
6257 | WithStatement
6258 | ReturnStatement
6259 | LabeledStatement
6260 | BreakStatement
6261 | ContinueStatement
6262 | IfStatement
6263 | SwitchStatement
6264 | ThrowStatement
6265 | TryStatement
6266 | WhileStatement
6267 | DoWhileStatement
6268 | ForStatement
6269 | ForInStatement
6270 | ForOfStatement
6271 | ImportDeclaration
6272 | ExportNamedDeclaration
6273 | ExportDefaultDeclaration
6274 | ExportAllDeclaration
6275 ): void;
6276
6277 /**
6278 * Walks a statements that is nested within a parent statement
6279 * and can potentially be a non-block statement.
6280 * This enforces the nested statement to never be in ASI position.
6281 */
6282 walkNestedStatement(statement: Statement): void;
6283 preWalkBlockStatement(statement: BlockStatement): void;
6284 walkBlockStatement(statement: BlockStatement): void;
6285 walkExpressionStatement(statement: ExpressionStatement): void;
6286 preWalkIfStatement(statement: IfStatement): void;
6287 walkIfStatement(statement: IfStatement): void;
6288 preWalkLabeledStatement(statement: LabeledStatement): void;
6289 walkLabeledStatement(statement: LabeledStatement): void;
6290 preWalkWithStatement(statement: WithStatement): void;
6291 walkWithStatement(statement: WithStatement): void;
6292 preWalkSwitchStatement(statement: SwitchStatement): void;
6293 walkSwitchStatement(statement: SwitchStatement): void;
6294 walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
6295 walkReturnStatement(statement: ReturnStatement): void;
6296 walkThrowStatement(statement: ThrowStatement): void;
6297 preWalkTryStatement(statement: TryStatement): void;
6298 walkTryStatement(statement: TryStatement): void;
6299 preWalkWhileStatement(statement: WhileStatement): void;
6300 walkWhileStatement(statement: WhileStatement): void;
6301 preWalkDoWhileStatement(statement: DoWhileStatement): void;
6302 walkDoWhileStatement(statement: DoWhileStatement): void;
6303 preWalkForStatement(statement: ForStatement): void;
6304 walkForStatement(statement: ForStatement): void;
6305 preWalkForInStatement(statement: ForInStatement): void;
6306 walkForInStatement(statement: ForInStatement): void;
6307 preWalkForOfStatement(statement: ForOfStatement): void;
6308 walkForOfStatement(statement: ForOfStatement): void;
6309 preWalkFunctionDeclaration(statement: FunctionDeclaration): void;
6310 walkFunctionDeclaration(statement: FunctionDeclaration): void;
6311 blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
6312 preWalkAssignmentExpression(expression: AssignmentExpression): void;
6313 blockPreWalkImportDeclaration(statement: ImportDeclaration): void;
6314 enterDeclaration(declaration: Declaration, onIdent?: any): void;
6315 blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
6316 walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
6317 blockPreWalkExportDefaultDeclaration(statement?: any): void;
6318 walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
6319 blockPreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
6320 preWalkVariableDeclaration(statement: VariableDeclaration): void;
6321 blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
6322 preWalkVariableDeclarator(declarator: VariableDeclarator): void;
6323 walkVariableDeclaration(statement: VariableDeclaration): void;
6324 blockPreWalkClassDeclaration(statement: ClassDeclaration): void;
6325 walkClassDeclaration(statement: ClassDeclaration): void;
6326 preWalkSwitchCases(switchCases: SwitchCase[]): void;
6327 walkSwitchCases(switchCases: SwitchCase[]): void;
6328 preWalkCatchClause(catchClause: CatchClause): void;
6329 walkCatchClause(catchClause: CatchClause): void;
6330 walkPattern(pattern: Pattern): void;
6331 walkAssignmentPattern(pattern: AssignmentPattern): void;
6332 walkObjectPattern(pattern: ObjectPattern): void;
6333 walkArrayPattern(pattern: ArrayPattern): void;
6334 walkRestElement(pattern: RestElement): void;
6335 walkExpressions(
6336 expressions: (
6337 | null
6338 | UnaryExpression
6339 | ArrayExpression
6340 | ArrowFunctionExpression
6341 | AssignmentExpression
6342 | AwaitExpression
6343 | BinaryExpression
6344 | SimpleCallExpression
6345 | NewExpression
6346 | ChainExpression
6347 | ClassExpression
6348 | ConditionalExpression
6349 | FunctionExpression
6350 | Identifier
6351 | ImportExpression
6352 | SimpleLiteral
6353 | RegExpLiteral
6354 | BigIntLiteral
6355 | LogicalExpression
6356 | MemberExpression
6357 | MetaProperty
6358 | ObjectExpression
6359 | SequenceExpression
6360 | TaggedTemplateExpression
6361 | TemplateLiteral
6362 | ThisExpression
6363 | UpdateExpression
6364 | YieldExpression
6365 | SpreadElement
6366 )[]
6367 ): void;
6368 walkExpression(expression?: any): void;
6369 walkAwaitExpression(expression: AwaitExpression): void;
6370 walkArrayExpression(expression: ArrayExpression): void;
6371 walkSpreadElement(expression: SpreadElement): void;
6372 walkObjectExpression(expression: ObjectExpression): void;
6373 walkProperty(prop: SpreadElement | Property): void;
6374 walkFunctionExpression(expression: FunctionExpression): void;
6375 walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
6376 walkSequenceExpression(expression: SequenceExpression): void;
6377 walkUpdateExpression(expression: UpdateExpression): void;
6378 walkUnaryExpression(expression: UnaryExpression): void;
6379 walkLeftRightExpression(
6380 expression: BinaryExpression | LogicalExpression
6381 ): void;
6382 walkBinaryExpression(expression: BinaryExpression): void;
6383 walkLogicalExpression(expression: LogicalExpression): void;
6384 walkAssignmentExpression(expression: AssignmentExpression): void;
6385 walkConditionalExpression(expression: ConditionalExpression): void;
6386 walkNewExpression(expression: NewExpression): void;
6387 walkYieldExpression(expression: YieldExpression): void;
6388 walkTemplateLiteral(expression: TemplateLiteral): void;
6389 walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
6390 walkClassExpression(expression: ClassExpression): void;
6391 walkChainExpression(expression: ChainExpression): void;
6392 walkImportExpression(expression: ImportExpression): void;
6393 walkCallExpression(expression: CallExpression): void;
6394 walkMemberExpression(expression: MemberExpression): void;
6395 walkMemberExpressionWithExpressionName(
6396 expression: any,
6397 name: string,
6398 rootInfo: string | VariableInfo,
6399 members: string[],
6400 onUnhandled?: any
6401 ): void;
6402 walkThisExpression(expression: ThisExpression): void;
6403 walkIdentifier(expression: Identifier): void;
6404 walkMetaProperty(metaProperty: MetaProperty): void;
6405 callHooksForExpression<T, R>(
6406 hookMap: HookMap<SyncBailHook<T, R>>,
6407 expr: any,
6408 ...args: AsArray<T>
6409 ): undefined | R;
6410 callHooksForExpressionWithFallback<T, R>(
6411 hookMap: HookMap<SyncBailHook<T, R>>,
6412 expr: MemberExpression,
6413 fallback:
6414 | undefined
6415 | ((
6416 arg0: string,
6417 arg1: string | ScopeInfo | VariableInfo,
6418 arg2: () => string[]
6419 ) => any),
6420 defined: undefined | ((arg0: string) => any),
6421 ...args: AsArray<T>
6422 ): undefined | R;
6423 callHooksForName<T, R>(
6424 hookMap: HookMap<SyncBailHook<T, R>>,
6425 name: string,
6426 ...args: AsArray<T>
6427 ): undefined | R;
6428 callHooksForInfo<T, R>(
6429 hookMap: HookMap<SyncBailHook<T, R>>,
6430 info: ExportedVariableInfo,
6431 ...args: AsArray<T>
6432 ): undefined | R;
6433 callHooksForInfoWithFallback<T, R>(
6434 hookMap: HookMap<SyncBailHook<T, R>>,
6435 info: ExportedVariableInfo,
6436 fallback: undefined | ((arg0: string) => any),
6437 defined: undefined | (() => any),
6438 ...args: AsArray<T>
6439 ): undefined | R;
6440 callHooksForNameWithFallback<T, R>(
6441 hookMap: HookMap<SyncBailHook<T, R>>,
6442 name: string,
6443 fallback: undefined | ((arg0: string) => any),
6444 defined: undefined | (() => any),
6445 ...args: AsArray<T>
6446 ): undefined | R;
6447 inScope(params: any, fn: () => void): void;
6448 inClassScope(hasThis: boolean, params: any, fn: () => void): void;
6449 inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
6450 inBlockScope(fn: () => void): void;
6451 detectMode(
6452 statements: (
6453 | FunctionDeclaration
6454 | VariableDeclaration
6455 | ClassDeclaration
6456 | ExpressionStatement
6457 | BlockStatement
6458 | StaticBlock
6459 | EmptyStatement
6460 | DebuggerStatement
6461 | WithStatement
6462 | ReturnStatement
6463 | LabeledStatement
6464 | BreakStatement
6465 | ContinueStatement
6466 | IfStatement
6467 | SwitchStatement
6468 | ThrowStatement
6469 | TryStatement
6470 | WhileStatement
6471 | DoWhileStatement
6472 | ForStatement
6473 | ForInStatement
6474 | ForOfStatement
6475 | ImportDeclaration
6476 | ExportNamedDeclaration
6477 | ExportDefaultDeclaration
6478 | ExportAllDeclaration
6479 | Directive
6480 )[]
6481 ): void;
6482 enterPatterns(
6483 patterns: (
6484 | string
6485 | Identifier
6486 | MemberExpression
6487 | ObjectPattern
6488 | ArrayPattern
6489 | RestElement
6490 | AssignmentPattern
6491 | Property
6492 )[],
6493 onIdent?: any
6494 ): void;
6495 enterPattern(
6496 pattern:
6497 | Identifier
6498 | MemberExpression
6499 | ObjectPattern
6500 | ArrayPattern
6501 | RestElement
6502 | AssignmentPattern
6503 | Property,
6504 onIdent?: any
6505 ): void;
6506 enterIdentifier(pattern: Identifier, onIdent?: any): void;
6507 enterObjectPattern(pattern: ObjectPattern, onIdent?: any): void;
6508 enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
6509 enterRestElement(pattern: RestElement, onIdent?: any): void;
6510 enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
6511 evaluateExpression(
6512 expression:
6513 | UnaryExpression
6514 | ArrayExpression
6515 | ArrowFunctionExpression
6516 | AssignmentExpression
6517 | AwaitExpression
6518 | BinaryExpression
6519 | SimpleCallExpression
6520 | NewExpression
6521 | ChainExpression
6522 | ClassExpression
6523 | ConditionalExpression
6524 | FunctionExpression
6525 | Identifier
6526 | ImportExpression
6527 | SimpleLiteral
6528 | RegExpLiteral
6529 | BigIntLiteral
6530 | LogicalExpression
6531 | MemberExpression
6532 | MetaProperty
6533 | ObjectExpression
6534 | SequenceExpression
6535 | TaggedTemplateExpression
6536 | TemplateLiteral
6537 | ThisExpression
6538 | UpdateExpression
6539 | YieldExpression
6540 | SpreadElement
6541 ): BasicEvaluatedExpression;
6542 parseString(expression: Expression): string;
6543 parseCalculatedString(expression: Expression): any;
6544 evaluate(source: string): BasicEvaluatedExpression;
6545 isPure(
6546 expr:
6547 | undefined
6548 | null
6549 | UnaryExpression
6550 | ArrayExpression
6551 | ArrowFunctionExpression
6552 | AssignmentExpression
6553 | AwaitExpression
6554 | BinaryExpression
6555 | SimpleCallExpression
6556 | NewExpression
6557 | ChainExpression
6558 | ClassExpression
6559 | ConditionalExpression
6560 | FunctionExpression
6561 | Identifier
6562 | ImportExpression
6563 | SimpleLiteral
6564 | RegExpLiteral
6565 | BigIntLiteral
6566 | LogicalExpression
6567 | MemberExpression
6568 | MetaProperty
6569 | ObjectExpression
6570 | SequenceExpression
6571 | TaggedTemplateExpression
6572 | TemplateLiteral
6573 | ThisExpression
6574 | UpdateExpression
6575 | YieldExpression
6576 | FunctionDeclaration
6577 | VariableDeclaration
6578 | ClassDeclaration
6579 | PrivateIdentifier,
6580 commentsStartPos: number
6581 ): boolean;
6582 getComments(range: [number, number]): Comment[];
6583 isAsiPosition(pos: number): boolean;
6584 setAsiPosition(pos: number): void;
6585 unsetAsiPosition(pos: number): void;
6586 isStatementLevelExpression(expr: Expression): boolean;
6587 getTagData(name: string, tag?: any): any;
6588 tagVariable(name: string, tag?: any, data?: any): void;
6589 defineVariable(name: string): void;
6590 undefineVariable(name: string): void;
6591 isVariableDefined(name: string): boolean;
6592 getVariableInfo(name: string): ExportedVariableInfo;
6593 setVariable(name: string, variableInfo: ExportedVariableInfo): void;
6594 evaluatedVariable(tagInfo: TagInfo): VariableInfo;
6595 parseCommentOptions(range: [number, number]): any;
6596 extractMemberExpressionChain(expression: MemberExpression): {
6597 members: string[];
6598 object:
6599 | UnaryExpression
6600 | ArrayExpression
6601 | ArrowFunctionExpression
6602 | AssignmentExpression
6603 | AwaitExpression
6604 | BinaryExpression
6605 | SimpleCallExpression
6606 | NewExpression
6607 | ChainExpression
6608 | ClassExpression
6609 | ConditionalExpression
6610 | FunctionExpression
6611 | Identifier
6612 | ImportExpression
6613 | SimpleLiteral
6614 | RegExpLiteral
6615 | BigIntLiteral
6616 | LogicalExpression
6617 | MemberExpression
6618 | MetaProperty
6619 | ObjectExpression
6620 | SequenceExpression
6621 | TaggedTemplateExpression
6622 | TemplateLiteral
6623 | ThisExpression
6624 | UpdateExpression
6625 | YieldExpression
6626 | Super;
6627 membersOptionals: boolean[];
6628 memberRanges: [number, number][];
6629 };
6630 getFreeInfoFromVariable(
6631 varName: string
6632 ): undefined | { name: string; info: string | VariableInfo };
6633 getMemberExpressionInfo(
6634 expression: MemberExpression,
6635 allowedTypes: number
6636 ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
6637 getNameForExpression(
6638 expression: MemberExpression
6639 ):
6640 | undefined
6641 | {
6642 name: string;
6643 rootInfo: ExportedVariableInfo;
6644 getMembers: () => string[];
6645 };
6646 static ALLOWED_MEMBER_TYPES_ALL: 3;
6647 static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
6648 static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
6649}
6650
6651/**
6652 * Parser options for javascript modules.
6653 */
6654declare interface JavascriptParserOptions {
6655 [index: string]: any;
6656
6657 /**
6658 * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
6659 */
6660 amd?: false | { [index: string]: any };
6661
6662 /**
6663 * Enable/disable special handling for browserify bundles.
6664 */
6665 browserify?: boolean;
6666
6667 /**
6668 * Enable/disable parsing of CommonJs syntax.
6669 */
6670 commonjs?: boolean;
6671
6672 /**
6673 * Enable/disable parsing of magic comments in CommonJs syntax.
6674 */
6675 commonjsMagicComments?: boolean;
6676
6677 /**
6678 * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
6679 */
6680 createRequire?: string | boolean;
6681
6682 /**
6683 * Specifies global fetchPriority for dynamic import.
6684 */
6685 dynamicImportFetchPriority?: false | "auto" | "low" | "high";
6686
6687 /**
6688 * Specifies global mode for dynamic import.
6689 */
6690 dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
6691
6692 /**
6693 * Specifies global prefetch for dynamic import.
6694 */
6695 dynamicImportPrefetch?: number | boolean;
6696
6697 /**
6698 * Specifies global preload for dynamic import.
6699 */
6700 dynamicImportPreload?: number | boolean;
6701
6702 /**
6703 * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
6704 */
6705 exportsPresence?: false | "auto" | "error" | "warn";
6706
6707 /**
6708 * Enable warnings for full dynamic dependencies.
6709 */
6710 exprContextCritical?: boolean;
6711
6712 /**
6713 * Enable recursive directory lookup for full dynamic dependencies.
6714 */
6715 exprContextRecursive?: boolean;
6716
6717 /**
6718 * Sets the default regular expression for full dynamic dependencies.
6719 */
6720 exprContextRegExp?: boolean | RegExp;
6721
6722 /**
6723 * Set the default request for full dynamic dependencies.
6724 */
6725 exprContextRequest?: string;
6726
6727 /**
6728 * Enable/disable parsing of EcmaScript Modules syntax.
6729 */
6730 harmony?: boolean;
6731
6732 /**
6733 * Enable/disable parsing of import() syntax.
6734 */
6735 import?: boolean;
6736
6737 /**
6738 * Specifies the behavior of invalid export names in "import ... from ...".
6739 */
6740 importExportsPresence?: false | "auto" | "error" | "warn";
6741
6742 /**
6743 * Enable/disable evaluating import.meta.
6744 */
6745 importMeta?: boolean;
6746
6747 /**
6748 * Enable/disable evaluating import.meta.webpackContext.
6749 */
6750 importMetaContext?: boolean;
6751
6752 /**
6753 * Include polyfills or mocks for various node stuff.
6754 */
6755 node?: false | NodeOptions;
6756
6757 /**
6758 * Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
6759 */
6760 overrideStrict?: "strict" | "non-strict";
6761
6762 /**
6763 * Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
6764 */
6765 reexportExportsPresence?: false | "auto" | "error" | "warn";
6766
6767 /**
6768 * Enable/disable parsing of require.context syntax.
6769 */
6770 requireContext?: boolean;
6771
6772 /**
6773 * Enable/disable parsing of require.ensure syntax.
6774 */
6775 requireEnsure?: boolean;
6776
6777 /**
6778 * Enable/disable parsing of require.include syntax.
6779 */
6780 requireInclude?: boolean;
6781
6782 /**
6783 * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
6784 */
6785 requireJs?: boolean;
6786
6787 /**
6788 * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
6789 */
6790 strictExportPresence?: boolean;
6791
6792 /**
6793 * Handle the this context correctly according to the spec for namespace objects.
6794 */
6795 strictThisContextOnImports?: boolean;
6796
6797 /**
6798 * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
6799 */
6800 system?: boolean;
6801
6802 /**
6803 * Enable warnings when using the require function in a not statically analyse-able way.
6804 */
6805 unknownContextCritical?: boolean;
6806
6807 /**
6808 * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
6809 */
6810 unknownContextRecursive?: boolean;
6811
6812 /**
6813 * Sets the regular expression when using the require function in a not statically analyse-able way.
6814 */
6815 unknownContextRegExp?: boolean | RegExp;
6816
6817 /**
6818 * Sets the request when using the require function in a not statically analyse-able way.
6819 */
6820 unknownContextRequest?: string;
6821
6822 /**
6823 * Enable/disable parsing of new URL() syntax.
6824 */
6825 url?: boolean | "relative";
6826
6827 /**
6828 * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
6829 */
6830 worker?: boolean | string[];
6831
6832 /**
6833 * Enable warnings for partial dynamic dependencies.
6834 */
6835 wrappedContextCritical?: boolean;
6836
6837 /**
6838 * Enable recursive directory lookup for partial dynamic dependencies.
6839 */
6840 wrappedContextRecursive?: boolean;
6841
6842 /**
6843 * Set the inner regular expression for partial dynamic dependencies.
6844 */
6845 wrappedContextRegExp?: RegExp;
6846}
6847type JsonObjectFs = { [index: string]: JsonValueFs } & {
6848 [index: string]:
6849 | undefined
6850 | null
6851 | string
6852 | number
6853 | boolean
6854 | JsonObjectFs
6855 | JsonValueFs[];
6856};
6857type JsonObjectTypes = { [index: string]: JsonValueTypes } & {
6858 [index: string]:
6859 | undefined
6860 | null
6861 | string
6862 | number
6863 | boolean
6864 | JsonObjectTypes
6865 | JsonValueTypes[];
6866};
6867type JsonValueFs =
6868 | null
6869 | string
6870 | number
6871 | boolean
6872 | JsonObjectFs
6873 | JsonValueFs[];
6874type JsonValueTypes =
6875 | null
6876 | string
6877 | number
6878 | boolean
6879 | JsonObjectTypes
6880 | JsonValueTypes[];
6881declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
6882 constructor(runtimeRequirements: ReadonlySet<string>);
6883 static getCompilationHooks(
6884 compilation: Compilation
6885 ): JsonpCompilationPluginHooks;
6886
6887 /**
6888 * Runtime modules without any dependencies to other runtime modules
6889 */
6890 static STAGE_NORMAL: number;
6891
6892 /**
6893 * Runtime modules with simple dependencies on other runtime modules
6894 */
6895 static STAGE_BASIC: number;
6896
6897 /**
6898 * Runtime modules which attach to handlers of other runtime modules
6899 */
6900 static STAGE_ATTACH: number;
6901
6902 /**
6903 * Runtime modules which trigger actions on bootstrap
6904 */
6905 static STAGE_TRIGGER: number;
6906}
6907declare interface JsonpCompilationPluginHooks {
6908 linkPreload: SyncWaterfallHook<[string, Chunk]>;
6909 linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
6910}
6911declare class JsonpTemplatePlugin {
6912 constructor();
6913
6914 /**
6915 * Apply the plugin
6916 */
6917 apply(compiler: Compiler): void;
6918 static getCompilationHooks(
6919 compilation: Compilation
6920 ): JsonpCompilationPluginHooks;
6921}
6922declare interface KnownAssetInfo {
6923 /**
6924 * true, if the asset can be long term cached forever (contains a hash)
6925 */
6926 immutable?: boolean;
6927
6928 /**
6929 * whether the asset is minimized
6930 */
6931 minimized?: boolean;
6932
6933 /**
6934 * the value(s) of the full hash used for this asset
6935 */
6936 fullhash?: string | string[];
6937
6938 /**
6939 * the value(s) of the chunk hash used for this asset
6940 */
6941 chunkhash?: string | string[];
6942
6943 /**
6944 * the value(s) of the module hash used for this asset
6945 */
6946 modulehash?: string | string[];
6947
6948 /**
6949 * the value(s) of the content hash used for this asset
6950 */
6951 contenthash?: string | string[];
6952
6953 /**
6954 * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
6955 */
6956 sourceFilename?: string;
6957
6958 /**
6959 * size in bytes, only set after asset has been emitted
6960 */
6961 size?: number;
6962
6963 /**
6964 * true, when asset is only used for development and doesn't count towards user-facing assets
6965 */
6966 development?: boolean;
6967
6968 /**
6969 * true, when asset ships data for updating an existing application (HMR)
6970 */
6971 hotModuleReplacement?: boolean;
6972
6973 /**
6974 * true, when asset is javascript and an ESM
6975 */
6976 javascriptModule?: boolean;
6977
6978 /**
6979 * object of pointers to other assets, keyed by type of relation (only points from parent to child)
6980 */
6981 related?: Record<string, string | string[]>;
6982}
6983declare interface KnownBuildInfo {
6984 cacheable?: boolean;
6985 parsed?: boolean;
6986 fileDependencies?: LazySet<string>;
6987 contextDependencies?: LazySet<string>;
6988 missingDependencies?: LazySet<string>;
6989 buildDependencies?: LazySet<string>;
6990 valueDependencies?: Map<string, ValueCacheVersion>;
6991 hash?: any;
6992 assets?: Record<string, Source>;
6993 assetsInfo?: Map<string, undefined | AssetInfo>;
6994 snapshot?: null | Snapshot;
6995}
6996declare interface KnownBuildMeta {
6997 moduleArgument?: string;
6998 exportsArgument?: string;
6999 strict?: boolean;
7000 moduleConcatenationBailout?: string;
7001 exportsType?: "namespace" | "dynamic" | "default" | "flagged";
7002 defaultObject?: false | "redirect" | "redirect-warn";
7003 strictHarmonyModule?: boolean;
7004 async?: boolean;
7005 sideEffectFree?: boolean;
7006}
7007declare interface KnownCreateStatsOptionsContext {
7008 forToString?: boolean;
7009}
7010declare interface KnownHooks {
7011 resolveStep: SyncHook<
7012 [
7013 AsyncSeriesBailHook<
7014 [ResolveRequest, ResolveContext],
7015 null | ResolveRequest
7016 >,
7017 ResolveRequest
7018 ]
7019 >;
7020 noResolve: SyncHook<[ResolveRequest, Error]>;
7021 resolve: AsyncSeriesBailHook<
7022 [ResolveRequest, ResolveContext],
7023 null | ResolveRequest
7024 >;
7025 result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
7026}
7027declare interface KnownNormalizedStatsOptions {
7028 context: string;
7029 requestShortener: RequestShortener;
7030 chunksSort: string;
7031 modulesSort: string;
7032 chunkModulesSort: string;
7033 nestedModulesSort: string;
7034 assetsSort: string;
7035 ids: boolean;
7036 cachedAssets: boolean;
7037 groupAssetsByEmitStatus: boolean;
7038 groupAssetsByPath: boolean;
7039 groupAssetsByExtension: boolean;
7040 assetsSpace: number;
7041 excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
7042 excludeModules: ((
7043 name: string,
7044 module: StatsModule,
7045 type: "module" | "chunk" | "root-of-chunk" | "nested"
7046 ) => boolean)[];
7047 warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
7048 cachedModules: boolean;
7049 orphanModules: boolean;
7050 dependentModules: boolean;
7051 runtimeModules: boolean;
7052 groupModulesByCacheStatus: boolean;
7053 groupModulesByLayer: boolean;
7054 groupModulesByAttributes: boolean;
7055 groupModulesByPath: boolean;
7056 groupModulesByExtension: boolean;
7057 groupModulesByType: boolean;
7058 entrypoints: boolean | "auto";
7059 chunkGroups: boolean;
7060 chunkGroupAuxiliary: boolean;
7061 chunkGroupChildren: boolean;
7062 chunkGroupMaxAssets: number;
7063 modulesSpace: number;
7064 chunkModulesSpace: number;
7065 nestedModulesSpace: number;
7066 logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
7067 loggingDebug: ((value: string) => boolean)[];
7068 loggingTrace: boolean;
7069}
7070declare interface KnownStatsAsset {
7071 type: string;
7072 name: string;
7073 info: AssetInfo;
7074 size: number;
7075 emitted: boolean;
7076 comparedForEmit: boolean;
7077 cached: boolean;
7078 related?: StatsAsset[];
7079 chunkNames?: (string | number)[];
7080 chunkIdHints?: (string | number)[];
7081 chunks?: (string | number)[];
7082 auxiliaryChunkNames?: (string | number)[];
7083 auxiliaryChunks?: (string | number)[];
7084 auxiliaryChunkIdHints?: (string | number)[];
7085 filteredRelated?: number;
7086 isOverSizeLimit?: boolean;
7087}
7088declare interface KnownStatsChunk {
7089 rendered: boolean;
7090 initial: boolean;
7091 entry: boolean;
7092 recorded: boolean;
7093 reason?: string;
7094 size: number;
7095 sizes: Record<string, number>;
7096 names: string[];
7097 idHints: string[];
7098 runtime?: string[];
7099 files: string[];
7100 auxiliaryFiles: string[];
7101 hash: string;
7102 childrenByOrder: Record<string, (string | number)[]>;
7103 id?: string | number;
7104 siblings?: (string | number)[];
7105 parents?: (string | number)[];
7106 children?: (string | number)[];
7107 modules?: StatsModule[];
7108 filteredModules?: number;
7109 origins?: StatsChunkOrigin[];
7110}
7111declare interface KnownStatsChunkGroup {
7112 name?: string;
7113 chunks?: (string | number)[];
7114 assets?: { name: string; size?: number }[];
7115 filteredAssets?: number;
7116 assetsSize?: number;
7117 auxiliaryAssets?: { name: string; size?: number }[];
7118 filteredAuxiliaryAssets?: number;
7119 auxiliaryAssetsSize?: number;
7120 children?: { [index: string]: StatsChunkGroup[] };
7121 childAssets?: { [index: string]: string[] };
7122 isOverSizeLimit?: boolean;
7123}
7124declare interface KnownStatsChunkOrigin {
7125 module: string;
7126 moduleIdentifier: string;
7127 moduleName: string;
7128 loc: string;
7129 request: string;
7130 moduleId?: string | number;
7131}
7132declare interface KnownStatsCompilation {
7133 env?: any;
7134 name?: string;
7135 hash?: string;
7136 version?: string;
7137 time?: number;
7138 builtAt?: number;
7139 needAdditionalPass?: boolean;
7140 publicPath?: string;
7141 outputPath?: string;
7142 assetsByChunkName?: Record<string, string[]>;
7143 assets?: StatsAsset[];
7144 filteredAssets?: number;
7145 chunks?: StatsChunk[];
7146 modules?: StatsModule[];
7147 filteredModules?: number;
7148 entrypoints?: Record<string, StatsChunkGroup>;
7149 namedChunkGroups?: Record<string, StatsChunkGroup>;
7150 errors?: StatsError[];
7151 errorsCount?: number;
7152 warnings?: StatsError[];
7153 warningsCount?: number;
7154 children?: StatsCompilation[];
7155 logging?: Record<string, StatsLogging>;
7156}
7157declare interface KnownStatsError {
7158 message: string;
7159 chunkName?: string;
7160 chunkEntry?: boolean;
7161 chunkInitial?: boolean;
7162 file?: string;
7163 moduleIdentifier?: string;
7164 moduleName?: string;
7165 loc?: string;
7166 chunkId?: string | number;
7167 moduleId?: string | number;
7168 moduleTrace?: StatsModuleTraceItem[];
7169 details?: any;
7170 stack?: string;
7171}
7172declare interface KnownStatsFactoryContext {
7173 type: string;
7174 makePathsRelative: (arg0: string) => string;
7175 compilation: Compilation;
7176 rootModules: Set<Module>;
7177 compilationFileToChunks: Map<string, Chunk[]>;
7178 compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
7179 runtime: RuntimeSpec;
7180 cachedGetErrors: (arg0: Compilation) => WebpackError[];
7181 cachedGetWarnings: (arg0: Compilation) => WebpackError[];
7182}
7183declare interface KnownStatsLogging {
7184 entries: StatsLoggingEntry[];
7185 filteredEntries: number;
7186 debug: boolean;
7187}
7188declare interface KnownStatsLoggingEntry {
7189 type: string;
7190 message?: string;
7191 trace?: string[];
7192 children?: StatsLoggingEntry[];
7193 args?: any[];
7194 time?: number;
7195}
7196declare interface KnownStatsModule {
7197 type?: string;
7198 moduleType?: string;
7199 layer?: null | string;
7200 identifier?: string;
7201 name?: string;
7202 nameForCondition?: null | string;
7203 index?: number;
7204 preOrderIndex?: number;
7205 index2?: number;
7206 postOrderIndex?: number;
7207 size?: number;
7208 sizes?: { [index: string]: number };
7209 cacheable?: boolean;
7210 built?: boolean;
7211 codeGenerated?: boolean;
7212 buildTimeExecuted?: boolean;
7213 cached?: boolean;
7214 optional?: boolean;
7215 orphan?: boolean;
7216 id?: string | number;
7217 issuerId?: null | string | number;
7218 chunks?: (string | number)[];
7219 assets?: (string | number)[];
7220 dependent?: boolean;
7221 issuer?: null | string;
7222 issuerName?: null | string;
7223 issuerPath?: StatsModuleIssuer[];
7224 failed?: boolean;
7225 errors?: number;
7226 warnings?: number;
7227 profile?: StatsProfile;
7228 reasons?: StatsModuleReason[];
7229 usedExports?: null | boolean | string[];
7230 providedExports?: null | string[];
7231 optimizationBailout?: string[];
7232 depth?: null | number;
7233 modules?: StatsModule[];
7234 filteredModules?: number;
7235 source?: string | Buffer;
7236}
7237declare interface KnownStatsModuleIssuer {
7238 identifier: string;
7239 name: string;
7240 id?: string | number;
7241 profile: StatsProfile;
7242}
7243declare interface KnownStatsModuleReason {
7244 moduleIdentifier: null | string;
7245 module: null | string;
7246 moduleName: null | string;
7247 resolvedModuleIdentifier: null | string;
7248 resolvedModule: null | string;
7249 type: null | string;
7250 active: boolean;
7251 explanation: null | string;
7252 userRequest: null | string;
7253 loc?: null | string;
7254 moduleId?: null | string | number;
7255 resolvedModuleId?: null | string | number;
7256}
7257declare interface KnownStatsModuleTraceDependency {
7258 loc?: string;
7259}
7260declare interface KnownStatsModuleTraceItem {
7261 originIdentifier?: string;
7262 originName?: string;
7263 moduleIdentifier?: string;
7264 moduleName?: string;
7265 dependencies?: StatsModuleTraceDependency[];
7266 originId?: string | number;
7267 moduleId?: string | number;
7268}
7269declare interface KnownStatsPrinterColorFn {
7270 bold?: (str: string) => string;
7271 yellow?: (str: string) => string;
7272 red?: (str: string) => string;
7273 green?: (str: string) => string;
7274 magenta?: (str: string) => string;
7275 cyan?: (str: string) => string;
7276}
7277declare interface KnownStatsPrinterContext {
7278 type?: string;
7279 compilation?: StatsCompilation;
7280 chunkGroup?: StatsChunkGroup;
7281 chunkGroupKind?: string;
7282 asset?: StatsAsset;
7283 module?: StatsModule;
7284 chunk?: StatsChunk;
7285 moduleReason?: StatsModuleReason;
7286 moduleIssuer?: StatsModuleIssuer;
7287 error?: StatsError;
7288 profile?: StatsProfile;
7289 logging?: StatsLogging;
7290 moduleTraceItem?: StatsModuleTraceItem;
7291 moduleTraceDependency?: StatsModuleTraceDependency;
7292}
7293declare interface KnownStatsPrinterFormaters {
7294 formatFilename?: (file: string, oversize?: boolean) => string;
7295 formatModuleId?: (id: string) => string;
7296 formatChunkId?: (
7297 id: string,
7298 direction?: "parent" | "child" | "sibling"
7299 ) => string;
7300 formatSize?: (size: number) => string;
7301 formatLayer?: (size: string) => string;
7302 formatDateTime?: (dateTime: number) => string;
7303 formatFlag?: (flag: string) => string;
7304 formatTime?: (time: number, boldQuantity?: boolean) => string;
7305 formatError?: (message: string) => string;
7306}
7307declare interface KnownStatsProfile {
7308 total: number;
7309 resolving: number;
7310 restoring: number;
7311 building: number;
7312 integration: number;
7313 storing: number;
7314 additionalResolving: number;
7315 additionalIntegration: number;
7316 factory: number;
7317 dependencies: number;
7318}
7319declare interface LStatFs {
7320 (
7321 path: PathLikeFs,
7322 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
7323 ): void;
7324 (
7325 path: PathLikeFs,
7326 options: undefined | (StatOptions & { bigint?: false }),
7327 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
7328 ): void;
7329 (
7330 path: PathLikeFs,
7331 options: StatOptions & { bigint: true },
7332 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
7333 ): void;
7334 (
7335 path: PathLikeFs,
7336 options: undefined | StatOptions,
7337 callback: (
7338 arg0: null | NodeJS.ErrnoException,
7339 arg1?: IStats | IBigIntStats
7340 ) => void
7341 ): void;
7342}
7343declare interface LStatSync {
7344 (path: PathLikeFs, options?: undefined): IStats;
7345 (
7346 path: PathLikeFs,
7347 options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
7348 ): undefined | IStats;
7349 (
7350 path: PathLikeFs,
7351 options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
7352 ): undefined | IBigIntStats;
7353 (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
7354 (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
7355 (
7356 path: PathLikeFs,
7357 options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
7358 ): IStats | IBigIntStats;
7359 (
7360 path: PathLikeFs,
7361 options?: StatSyncOptions
7362 ): undefined | IStats | IBigIntStats;
7363}
7364declare interface LStatTypes {
7365 (
7366 path: PathLikeTypes,
7367 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
7368 ): void;
7369 (
7370 path: PathLikeTypes,
7371 options: undefined | (StatOptions & { bigint?: false }),
7372 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
7373 ): void;
7374 (
7375 path: PathLikeTypes,
7376 options: StatOptions & { bigint: true },
7377 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
7378 ): void;
7379 (
7380 path: PathLikeTypes,
7381 options: undefined | StatOptions,
7382 callback: (
7383 arg0: null | NodeJS.ErrnoException,
7384 arg1?: IStats | IBigIntStats
7385 ) => void
7386 ): void;
7387}
7388
7389/**
7390 * Options for the default backend.
7391 */
7392declare interface LazyCompilationDefaultBackendOptions {
7393 /**
7394 * A custom client.
7395 */
7396 client?: string;
7397
7398 /**
7399 * Specifies where to listen to from the server.
7400 */
7401 listen?: number | ListenOptions | ((server: Server) => void);
7402
7403 /**
7404 * Specifies the protocol the client should use to connect to the server.
7405 */
7406 protocol?: "http" | "https";
7407
7408 /**
7409 * Specifies how to create the server handling the EventSource requests.
7410 */
7411 server?:
7412 | ServerOptionsImport<typeof IncomingMessage>
7413 | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
7414 | (() => Server);
7415}
7416
7417/**
7418 * Options for compiling entrypoints and import()s only when they are accessed.
7419 */
7420declare interface LazyCompilationOptions {
7421 /**
7422 * Specifies the backend that should be used for handling client keep alive.
7423 */
7424 backend?:
7425 | ((
7426 compiler: Compiler,
7427 callback: (err?: Error, api?: BackendApi) => void
7428 ) => void)
7429 | ((compiler: Compiler) => Promise<BackendApi>)
7430 | LazyCompilationDefaultBackendOptions;
7431
7432 /**
7433 * Enable/disable lazy compilation for entries.
7434 */
7435 entries?: boolean;
7436
7437 /**
7438 * Enable/disable lazy compilation for import() modules.
7439 */
7440 imports?: boolean;
7441
7442 /**
7443 * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
7444 */
7445 test?: string | RegExp | ((module: Module) => boolean);
7446}
7447declare class LazySet<T> {
7448 constructor(iterable?: Iterable<T>);
7449 get size(): number;
7450 add(item: T): LazySet<T>;
7451 addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
7452 clear(): void;
7453 delete(value: T): boolean;
7454 entries(): IterableIterator<[T, T]>;
7455 forEach(
7456 callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
7457 thisArg?: any
7458 ): void;
7459 has(item: T): boolean;
7460 keys(): IterableIterator<T>;
7461 values(): IterableIterator<T>;
7462 serialize(__0: ObjectSerializerContext): void;
7463 [Symbol.iterator](): IterableIterator<T>;
7464 static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
7465}
7466declare interface LibIdentOptions {
7467 /**
7468 * absolute context path to which lib ident is relative to
7469 */
7470 context: string;
7471
7472 /**
7473 * object for caching
7474 */
7475 associatedObjectForCache?: object;
7476}
7477declare class LibManifestPlugin {
7478 constructor(options: LibManifestPluginOptions);
7479 options: LibManifestPluginOptions;
7480
7481 /**
7482 * Apply the plugin
7483 */
7484 apply(compiler: Compiler): void;
7485}
7486declare interface LibManifestPluginOptions {
7487 /**
7488 * Context of requests in the manifest file (defaults to the webpack context).
7489 */
7490 context?: string;
7491
7492 /**
7493 * If true, only entry points will be exposed (default: true).
7494 */
7495 entryOnly?: boolean;
7496
7497 /**
7498 * If true, manifest json file (output) will be formatted.
7499 */
7500 format?: boolean;
7501
7502 /**
7503 * Name of the exposed dll function (external name, use value of 'output.library').
7504 */
7505 name?: string;
7506
7507 /**
7508 * Absolute path to the manifest json file (output).
7509 */
7510 path: string;
7511
7512 /**
7513 * Type of the dll bundle (external type, use value of 'output.libraryTarget').
7514 */
7515 type?: string;
7516}
7517declare interface LibraryContext<T> {
7518 compilation: Compilation;
7519 chunkGraph: ChunkGraph;
7520 options: T;
7521}
7522
7523/**
7524 * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
7525 */
7526declare interface LibraryCustomUmdCommentObject {
7527 /**
7528 * Set comment for `amd` section in UMD.
7529 */
7530 amd?: string;
7531
7532 /**
7533 * Set comment for `commonjs` (exports) section in UMD.
7534 */
7535 commonjs?: string;
7536
7537 /**
7538 * Set comment for `commonjs2` (module.exports) section in UMD.
7539 */
7540 commonjs2?: string;
7541
7542 /**
7543 * Set comment for `root` (global variable) section in UMD.
7544 */
7545 root?: string;
7546}
7547
7548/**
7549 * Description object for all UMD variants of the library name.
7550 */
7551declare interface LibraryCustomUmdObject {
7552 /**
7553 * Name of the exposed AMD library in the UMD.
7554 */
7555 amd?: string;
7556
7557 /**
7558 * Name of the exposed commonjs export in the UMD.
7559 */
7560 commonjs?: string;
7561
7562 /**
7563 * Name of the property exposed globally by a UMD library.
7564 */
7565 root?: string | string[];
7566}
7567type LibraryExport = string | string[];
7568type LibraryName = string | string[] | LibraryCustomUmdObject;
7569
7570/**
7571 * Options for library.
7572 */
7573declare interface LibraryOptions {
7574 /**
7575 * Add a container for define/require functions in the AMD module.
7576 */
7577 amdContainer?: string;
7578
7579 /**
7580 * Add a comment in the UMD wrapper.
7581 */
7582 auxiliaryComment?: string | LibraryCustomUmdCommentObject;
7583
7584 /**
7585 * Specify which export should be exposed as library.
7586 */
7587 export?: string | string[];
7588
7589 /**
7590 * The name of the library (some types allow unnamed libraries too).
7591 */
7592 name?: string | string[] | LibraryCustomUmdObject;
7593
7594 /**
7595 * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
7596 */
7597 type: string;
7598
7599 /**
7600 * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
7601 */
7602 umdNamedDefine?: boolean;
7603}
7604declare class LibraryTemplatePlugin {
7605 constructor(
7606 name: LibraryName,
7607 target: string,
7608 umdNamedDefine: boolean,
7609 auxiliaryComment: AuxiliaryComment,
7610 exportProperty: LibraryExport
7611 );
7612 library: {
7613 type: string;
7614 name: LibraryName;
7615 umdNamedDefine: boolean;
7616 auxiliaryComment: AuxiliaryComment;
7617 export: LibraryExport;
7618 };
7619
7620 /**
7621 * Apply the plugin
7622 */
7623 apply(compiler: Compiler): void;
7624}
7625declare class LimitChunkCountPlugin {
7626 constructor(options?: LimitChunkCountPluginOptions);
7627 options?: LimitChunkCountPluginOptions;
7628 apply(compiler: Compiler): void;
7629}
7630declare interface LimitChunkCountPluginOptions {
7631 /**
7632 * Constant overhead for a chunk.
7633 */
7634 chunkOverhead?: number;
7635
7636 /**
7637 * Multiplicator for initial chunks.
7638 */
7639 entryChunkMultiplicator?: number;
7640
7641 /**
7642 * Limit the maximum number of chunks using a value greater greater than or equal to 1.
7643 */
7644 maxChunks: number;
7645}
7646declare interface LoadScriptCompilationHooks {
7647 createScript: SyncWaterfallHook<[string, Chunk]>;
7648}
7649declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
7650 constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
7651 static getCompilationHooks(
7652 compilation: Compilation
7653 ): LoadScriptCompilationHooks;
7654
7655 /**
7656 * Runtime modules without any dependencies to other runtime modules
7657 */
7658 static STAGE_NORMAL: number;
7659
7660 /**
7661 * Runtime modules with simple dependencies on other runtime modules
7662 */
7663 static STAGE_BASIC: number;
7664
7665 /**
7666 * Runtime modules which attach to handlers of other runtime modules
7667 */
7668 static STAGE_ATTACH: number;
7669
7670 /**
7671 * Runtime modules which trigger actions on bootstrap
7672 */
7673 static STAGE_TRIGGER: number;
7674}
7675
7676/**
7677 * Custom values available in the loader context.
7678 */
7679declare interface Loader {
7680 [index: string]: any;
7681}
7682type LoaderContextDeclarationsIndex<OptionsType> =
7683 NormalModuleLoaderContext<OptionsType> &
7684 LoaderRunnerLoaderContext<OptionsType> &
7685 LoaderPluginLoaderContext &
7686 HotModuleReplacementPluginLoaderContext;
7687type LoaderContextNormalModule<T> = NormalModuleLoaderContext<T> &
7688 LoaderRunnerLoaderContext<T> &
7689 LoaderPluginLoaderContext &
7690 HotModuleReplacementPluginLoaderContext;
7691type LoaderDefinition<
7692 OptionsType = {},
7693 ContextAdditions = {}
7694> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
7695 raw?: false;
7696 pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
7697};
7698declare interface LoaderDefinitionFunction<
7699 OptionsType = {},
7700 ContextAdditions = {}
7701> {
7702 (
7703 this: NormalModuleLoaderContext<OptionsType> &
7704 LoaderRunnerLoaderContext<OptionsType> &
7705 LoaderPluginLoaderContext &
7706 HotModuleReplacementPluginLoaderContext &
7707 ContextAdditions,
7708 content: string,
7709 sourceMap?: string | SourceMap,
7710 additionalData?: AdditionalData
7711 ): string | void | Buffer | Promise<string | Buffer>;
7712}
7713declare interface LoaderItem {
7714 loader: string;
7715 options: any;
7716 ident: null | string;
7717 type: null | string;
7718}
7719declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
7720 default?:
7721 | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
7722 | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
7723 raw?: false;
7724 pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
7725}
7726declare class LoaderOptionsPlugin {
7727 constructor(options?: LoaderOptionsPluginOptions & MatchObject);
7728 options: LoaderOptionsPluginOptions & MatchObject;
7729
7730 /**
7731 * Apply the plugin
7732 */
7733 apply(compiler: Compiler): void;
7734}
7735declare interface LoaderOptionsPluginOptions {
7736 [index: string]: any;
7737
7738 /**
7739 * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
7740 */
7741 debug?: boolean;
7742
7743 /**
7744 * Where loaders can be switched to minimize mode.
7745 */
7746 minimize?: boolean;
7747
7748 /**
7749 * A configuration object that can be used to configure older loaders.
7750 */
7751 options?: {
7752 [index: string]: any;
7753 /**
7754 * The context that can be used to configure older loaders.
7755 */
7756 context?: string;
7757 };
7758}
7759
7760/**
7761 * These properties are added by the LoaderPlugin
7762 */
7763declare interface LoaderPluginLoaderContext {
7764 /**
7765 * Resolves the given request to a module, applies all configured loaders and calls
7766 * back with the generated source, the sourceMap and the module instance (usually an
7767 * instance of NormalModule). Use this function if you need to know the source code
7768 * of another module to generate the result.
7769 */
7770 loadModule(
7771 request: string,
7772 callback: (
7773 err: null | Error,
7774 source?: string | Buffer,
7775 sourceMap?: null | object,
7776 module?: Module
7777 ) => void
7778 ): void;
7779 importModule(
7780 request: string,
7781 options: undefined | ImportModuleOptions,
7782 callback: (err?: null | Error, exports?: any) => any
7783 ): void;
7784 importModule(request: string, options?: ImportModuleOptions): Promise<any>;
7785}
7786
7787/**
7788 * The properties are added by https://github.com/webpack/loader-runner
7789 */
7790declare interface LoaderRunnerLoaderContext<OptionsType> {
7791 /**
7792 * Add a directory as dependency of the loader result.
7793 */
7794 addContextDependency(context: string): void;
7795
7796 /**
7797 * Adds a file as dependency of the loader result in order to make them watchable.
7798 * For example, html-loader uses this technique as it finds src and src-set attributes.
7799 * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
7800 */
7801 addDependency(file: string): void;
7802 addMissingDependency(context: string): void;
7803
7804 /**
7805 * Make this loader async.
7806 */
7807 async(): (
7808 err?: null | Error,
7809 content?: string | Buffer,
7810 sourceMap?: string | SourceMap,
7811 additionalData?: AdditionalData
7812 ) => void;
7813
7814 /**
7815 * Make this loader result cacheable. By default it's cacheable.
7816 * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
7817 * This means the loader shouldn't have other dependencies than specified with this.addDependency.
7818 * Most loaders are deterministic and cacheable.
7819 */
7820 cacheable(flag?: boolean): void;
7821 callback: (
7822 err?: null | Error,
7823 content?: string | Buffer,
7824 sourceMap?: string | SourceMap,
7825 additionalData?: AdditionalData
7826 ) => void;
7827
7828 /**
7829 * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
7830 */
7831 clearDependencies(): void;
7832
7833 /**
7834 * The directory of the module. Can be used as context for resolving other stuff.
7835 * eg '/workspaces/ts-loader/examples/vanilla/src'
7836 */
7837 context: string;
7838 readonly currentRequest: string;
7839 readonly data: any;
7840
7841 /**
7842 * alias of addDependency
7843 * Adds a file as dependency of the loader result in order to make them watchable.
7844 * For example, html-loader uses this technique as it finds src and src-set attributes.
7845 * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
7846 */
7847 dependency(file: string): void;
7848 getContextDependencies(): string[];
7849 getDependencies(): string[];
7850 getMissingDependencies(): string[];
7851
7852 /**
7853 * The index in the loaders array of the current loader.
7854 * In the example: in loader1: 0, in loader2: 1
7855 */
7856 loaderIndex: number;
7857 readonly previousRequest: string;
7858 readonly query: string | OptionsType;
7859 readonly remainingRequest: string;
7860 readonly request: string;
7861
7862 /**
7863 * An array of all the loaders. It is writeable in the pitch phase.
7864 * loaders = [{request: string, path: string, query: string, module: function}]
7865 * In the example:
7866 * [
7867 * { request: "/abc/loader1.js?xyz",
7868 * path: "/abc/loader1.js",
7869 * query: "?xyz",
7870 * module: [Function]
7871 * },
7872 * { request: "/abc/node_modules/loader2/index.js",
7873 * path: "/abc/node_modules/loader2/index.js",
7874 * query: "",
7875 * module: [Function]
7876 * }
7877 * ]
7878 */
7879 loaders: {
7880 request: string;
7881 path: string;
7882 query: string;
7883 fragment: string;
7884 options?: string | object;
7885 ident: string;
7886 normal?: Function;
7887 pitch?: Function;
7888 raw?: boolean;
7889 data?: object;
7890 pitchExecuted: boolean;
7891 normalExecuted: boolean;
7892 type?: "module" | "commonjs";
7893 }[];
7894
7895 /**
7896 * The resource path.
7897 * In the example: "/abc/resource.js"
7898 */
7899 resourcePath: string;
7900
7901 /**
7902 * The resource query string.
7903 * Example: "?query"
7904 */
7905 resourceQuery: string;
7906
7907 /**
7908 * The resource fragment.
7909 * Example: "#frag"
7910 */
7911 resourceFragment: string;
7912
7913 /**
7914 * The resource inclusive query and fragment.
7915 * Example: "/abc/resource.js?query#frag"
7916 */
7917 resource: string;
7918
7919 /**
7920 * Target of compilation.
7921 * Example: "web"
7922 */
7923 target: string;
7924
7925 /**
7926 * Tell what kind of ES-features may be used in the generated runtime-code.
7927 * Example: { arrowFunction: true }
7928 */
7929 environment: Environment;
7930}
7931declare class LoaderTargetPlugin {
7932 constructor(target: string);
7933 target: string;
7934
7935 /**
7936 * Apply the plugin
7937 */
7938 apply(compiler: Compiler): void;
7939}
7940declare interface LogEntry {
7941 type: string;
7942 args?: any[];
7943 time: number;
7944 trace?: string[];
7945}
7946type LogTypeEnum =
7947 | "error"
7948 | "warn"
7949 | "info"
7950 | "log"
7951 | "debug"
7952 | "profile"
7953 | "trace"
7954 | "group"
7955 | "groupCollapsed"
7956 | "groupEnd"
7957 | "profileEnd"
7958 | "time"
7959 | "clear"
7960 | "status";
7961declare const MEASURE_END_OPERATION: unique symbol;
7962declare const MEASURE_START_OPERATION: unique symbol;
7963declare interface MainRenderContext {
7964 /**
7965 * the chunk
7966 */
7967 chunk: Chunk;
7968
7969 /**
7970 * the dependency templates
7971 */
7972 dependencyTemplates: DependencyTemplates;
7973
7974 /**
7975 * the runtime template
7976 */
7977 runtimeTemplate: RuntimeTemplate;
7978
7979 /**
7980 * the module graph
7981 */
7982 moduleGraph: ModuleGraph;
7983
7984 /**
7985 * the chunk graph
7986 */
7987 chunkGraph: ChunkGraph;
7988
7989 /**
7990 * results of code generation
7991 */
7992 codeGenerationResults: CodeGenerationResults;
7993
7994 /**
7995 * hash to be used for render call
7996 */
7997 hash: string;
7998
7999 /**
8000 * rendering in strict context
8001 */
8002 strictMode?: boolean;
8003}
8004declare abstract class MainTemplate {
8005 hooks: Readonly<{
8006 renderManifest: {
8007 tap: <AdditionalOptions>(
8008 options:
8009 | string
8010 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8011 fn: (
8012 arg0: RenderManifestEntry[],
8013 arg1: RenderManifestOptions
8014 ) => RenderManifestEntry[]
8015 ) => void;
8016 };
8017 modules: { tap: () => never };
8018 moduleObj: { tap: () => never };
8019 require: {
8020 tap: <AdditionalOptions>(
8021 options:
8022 | string
8023 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8024 fn: (arg0: string, arg1: RenderBootstrapContext) => string
8025 ) => void;
8026 };
8027 beforeStartup: { tap: () => never };
8028 startup: { tap: () => never };
8029 afterStartup: { tap: () => never };
8030 render: {
8031 tap: <AdditionalOptions>(
8032 options:
8033 | string
8034 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8035 fn: (
8036 arg0: Source,
8037 arg1: Chunk,
8038 arg2: undefined | string,
8039 arg3: ModuleTemplate,
8040 arg4: DependencyTemplates
8041 ) => Source
8042 ) => void;
8043 };
8044 renderWithEntry: {
8045 tap: <AdditionalOptions>(
8046 options:
8047 | string
8048 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8049 fn: (arg0: Source, arg1: Chunk, arg2?: string) => Source
8050 ) => void;
8051 };
8052 assetPath: {
8053 tap: <AdditionalOptions>(
8054 options:
8055 | string
8056 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8057 fn: (arg0: string, arg1: object, arg2?: AssetInfo) => string
8058 ) => void;
8059 call: (filename: TemplatePath, options: PathData) => string;
8060 };
8061 hash: {
8062 tap: <AdditionalOptions>(
8063 options:
8064 | string
8065 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8066 fn: (arg0: Hash) => void
8067 ) => void;
8068 };
8069 hashForChunk: {
8070 tap: <AdditionalOptions>(
8071 options:
8072 | string
8073 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8074 fn: (arg0: Hash, arg1: Chunk) => void
8075 ) => void;
8076 };
8077 globalHashPaths: { tap: () => void };
8078 globalHash: { tap: () => void };
8079 hotBootstrap: { tap: () => never };
8080 bootstrap: SyncWaterfallHook<
8081 [string, Chunk, string, ModuleTemplate, DependencyTemplates]
8082 >;
8083 localVars: SyncWaterfallHook<[string, Chunk, string]>;
8084 requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
8085 requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
8086 get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
8087 get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
8088 get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
8089 }>;
8090 renderCurrentHashCode: (hash: string, length?: number) => string;
8091 getPublicPath: (options: PathData) => string;
8092 getAssetPath: (path: TemplatePath, options: PathData) => string;
8093 getAssetPathWithInfo: (
8094 path: TemplatePath,
8095 options: PathData
8096 ) => InterpolatedPathAndAssetInfo;
8097 get requireFn(): "__webpack_require__";
8098 get outputOptions(): Output;
8099}
8100declare interface MakeDirectoryOptions {
8101 recursive?: boolean;
8102 mode?: string | number;
8103}
8104declare interface MapOptions {
8105 columns?: boolean;
8106 module?: boolean;
8107}
8108declare interface MatchObject {
8109 test?: string | RegExp | (string | RegExp)[];
8110 include?: string | RegExp | (string | RegExp)[];
8111 exclude?: string | RegExp | (string | RegExp)[];
8112}
8113type Matcher = string | RegExp | (string | RegExp)[];
8114
8115/**
8116 * Options object for in-memory caching.
8117 */
8118declare interface MemoryCacheOptions {
8119 /**
8120 * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
8121 */
8122 cacheUnaffected?: boolean;
8123
8124 /**
8125 * Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).
8126 */
8127 maxGenerations?: number;
8128
8129 /**
8130 * In memory caching.
8131 */
8132 type: "memory";
8133}
8134declare class MemoryCachePlugin {
8135 constructor();
8136
8137 /**
8138 * Apply the plugin
8139 */
8140 apply(compiler: Compiler): void;
8141}
8142declare class MinChunkSizePlugin {
8143 constructor(options: MinChunkSizePluginOptions);
8144 options: MinChunkSizePluginOptions;
8145
8146 /**
8147 * Apply the plugin
8148 */
8149 apply(compiler: Compiler): void;
8150}
8151declare interface MinChunkSizePluginOptions {
8152 /**
8153 * Constant overhead for a chunk.
8154 */
8155 chunkOverhead?: number;
8156
8157 /**
8158 * Multiplicator for initial chunks.
8159 */
8160 entryChunkMultiplicator?: number;
8161
8162 /**
8163 * Minimum number of characters.
8164 */
8165 minChunkSize: number;
8166}
8167declare interface Mkdir {
8168 (
8169 file: PathLikeFs,
8170 options: MakeDirectoryOptions & { recursive: true },
8171 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
8172 ): void;
8173 (
8174 file: PathLikeFs,
8175 options:
8176 | undefined
8177 | null
8178 | string
8179 | number
8180 | (MakeDirectoryOptions & { recursive?: false }),
8181 callback: (arg0: null | NodeJS.ErrnoException) => void
8182 ): void;
8183 (
8184 file: PathLikeFs,
8185 options: undefined | null | string | number | MakeDirectoryOptions,
8186 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
8187 ): void;
8188 (
8189 file: PathLikeFs,
8190 callback: (arg0: null | NodeJS.ErrnoException) => void
8191 ): void;
8192}
8193declare interface MkdirSync {
8194 (
8195 path: PathLikeFs,
8196 options: MakeDirectoryOptions & { recursive: true }
8197 ): undefined | string;
8198 (
8199 path: PathLikeFs,
8200 options?:
8201 | null
8202 | string
8203 | number
8204 | (MakeDirectoryOptions & { recursive?: false })
8205 ): void;
8206 (
8207 path: PathLikeFs,
8208 options?: null | string | number | MakeDirectoryOptions
8209 ): undefined | string;
8210}
8211declare class Module extends DependenciesBlock {
8212 constructor(type: string, context?: null | string, layer?: null | string);
8213 type: string;
8214 context: null | string;
8215 layer: null | string;
8216 needId: boolean;
8217 debugId: number;
8218 resolveOptions?: ResolveOptions;
8219 factoryMeta?: FactoryMeta;
8220 useSourceMap: boolean;
8221 useSimpleSourceMap: boolean;
8222 buildMeta?: BuildMeta;
8223 buildInfo?: BuildInfo;
8224 presentationalDependencies?: Dependency[];
8225 codeGenerationDependencies?: Dependency[];
8226 id: null | string | number;
8227 get hash(): string;
8228 get renderedHash(): string;
8229 profile?: ModuleProfile;
8230 index: null | number;
8231 index2: null | number;
8232 depth: null | number;
8233 issuer?: null | Module;
8234 get usedExports(): null | boolean | SortableSet<string>;
8235 get optimizationBailout(): (
8236 | string
8237 | ((requestShortener: RequestShortener) => string)
8238 )[];
8239 get optional(): boolean;
8240 addChunk(chunk: Chunk): boolean;
8241 removeChunk(chunk: Chunk): void;
8242 isInChunk(chunk: Chunk): boolean;
8243 isEntryModule(): boolean;
8244 getChunks(): Chunk[];
8245 getNumberOfChunks(): number;
8246 get chunksIterable(): Iterable<Chunk>;
8247 isProvided(exportName: string): null | boolean;
8248 get exportsArgument(): string;
8249 get moduleArgument(): string;
8250 getExportsType(
8251 moduleGraph: ModuleGraph,
8252 strict?: boolean
8253 ): "namespace" | "default-only" | "default-with-named" | "dynamic";
8254 addPresentationalDependency(presentationalDependency: Dependency): void;
8255 addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
8256 addWarning(warning: WebpackError): void;
8257 getWarnings(): undefined | Iterable<WebpackError>;
8258 getNumberOfWarnings(): number;
8259 addError(error: WebpackError): void;
8260 getErrors(): undefined | Iterable<WebpackError>;
8261 getNumberOfErrors(): number;
8262
8263 /**
8264 * removes all warnings and errors
8265 */
8266 clearWarningsAndErrors(): void;
8267 isOptional(moduleGraph: ModuleGraph): boolean;
8268 isAccessibleInChunk(
8269 chunkGraph: ChunkGraph,
8270 chunk: Chunk,
8271 ignoreChunk?: Chunk
8272 ): boolean;
8273 isAccessibleInChunkGroup(
8274 chunkGraph: ChunkGraph,
8275 chunkGroup: ChunkGroup,
8276 ignoreChunk?: Chunk
8277 ): boolean;
8278 hasReasonForChunk(
8279 chunk: Chunk,
8280 moduleGraph: ModuleGraph,
8281 chunkGraph: ChunkGraph
8282 ): boolean;
8283 hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
8284 needBuild(
8285 context: NeedBuildContext,
8286 callback: (arg0?: null | WebpackError, arg1?: boolean) => void
8287 ): void;
8288 needRebuild(
8289 fileTimestamps: Map<string, null | number>,
8290 contextTimestamps: Map<string, null | number>
8291 ): boolean;
8292 invalidateBuild(): void;
8293 identifier(): string;
8294 readableIdentifier(requestShortener: RequestShortener): string;
8295 build(
8296 options: WebpackOptionsNormalized,
8297 compilation: Compilation,
8298 resolver: ResolverWithOptions,
8299 fs: InputFileSystem,
8300 callback: (arg0?: WebpackError) => void
8301 ): void;
8302 getSourceTypes(): Set<string>;
8303 source(
8304 dependencyTemplates: DependencyTemplates,
8305 runtimeTemplate: RuntimeTemplate,
8306 type?: string
8307 ): Source;
8308 size(type?: string): number;
8309 libIdent(options: LibIdentOptions): null | string;
8310 nameForCondition(): null | string;
8311 getConcatenationBailoutReason(
8312 context: ConcatenationBailoutReasonContext
8313 ): undefined | string;
8314 getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
8315 codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
8316 chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
8317 hasChunkCondition(): boolean;
8318
8319 /**
8320 * Assuming this module is in the cache. Update the (cached) module with
8321 * the fresh module from the factory. Usually updates internal references
8322 * and properties.
8323 */
8324 updateCacheModule(module: Module): void;
8325
8326 /**
8327 * Module should be unsafe cached. Get data that's needed for that.
8328 * This data will be passed to restoreFromUnsafeCache later.
8329 */
8330 getUnsafeCacheData(): UnsafeCacheData;
8331
8332 /**
8333 * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
8334 */
8335 cleanupForCache(): void;
8336 originalSource(): null | Source;
8337 addCacheDependencies(
8338 fileDependencies: LazySet<string>,
8339 contextDependencies: LazySet<string>,
8340 missingDependencies: LazySet<string>,
8341 buildDependencies: LazySet<string>
8342 ): void;
8343 get hasEqualsChunks(): any;
8344 get isUsed(): any;
8345 get errors(): any;
8346 get warnings(): any;
8347 used: any;
8348}
8349declare class ModuleConcatenationPlugin {
8350 constructor();
8351
8352 /**
8353 * Apply the plugin
8354 */
8355 apply(compiler: Compiler): void;
8356}
8357declare class ModuleDependency extends Dependency {
8358 constructor(request: string);
8359 request: string;
8360 userRequest: string;
8361 range: any;
8362 assertions?: ImportAttributes;
8363 static Template: typeof DependencyTemplate;
8364 static NO_EXPORTS_REFERENCED: string[][];
8365 static EXPORTS_OBJECT_REFERENCED: string[][];
8366 static TRANSITIVE: typeof TRANSITIVE;
8367}
8368declare abstract class ModuleFactory {
8369 create(
8370 data: ModuleFactoryCreateData,
8371 callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
8372 ): void;
8373}
8374declare interface ModuleFactoryCreateData {
8375 contextInfo: ModuleFactoryCreateDataContextInfo;
8376 resolveOptions?: ResolveOptions;
8377 context: string;
8378 dependencies: Dependency[];
8379}
8380declare interface ModuleFactoryCreateDataContextInfo {
8381 issuer: string;
8382 issuerLayer?: null | string;
8383 compiler: string;
8384}
8385declare interface ModuleFactoryResult {
8386 /**
8387 * the created module or unset if no module was created
8388 */
8389 module?: Module;
8390 fileDependencies?: Set<string>;
8391 contextDependencies?: Set<string>;
8392 missingDependencies?: Set<string>;
8393
8394 /**
8395 * allow to use the unsafe cache
8396 */
8397 cacheable?: boolean;
8398}
8399declare class ModuleFederationPlugin {
8400 constructor(options: ModuleFederationPluginOptions);
8401
8402 /**
8403 * Apply the plugin
8404 */
8405 apply(compiler: Compiler): void;
8406}
8407declare interface ModuleFederationPluginOptions {
8408 /**
8409 * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
8410 */
8411 exposes?: (string | ExposesObject)[] | ExposesObject;
8412
8413 /**
8414 * The filename of the container as relative path inside the `output.path` directory.
8415 */
8416 filename?: string;
8417
8418 /**
8419 * Options for library.
8420 */
8421 library?: LibraryOptions;
8422
8423 /**
8424 * The name of the container.
8425 */
8426 name?: string;
8427
8428 /**
8429 * The external type of the remote containers.
8430 */
8431 remoteType?:
8432 | "import"
8433 | "var"
8434 | "module"
8435 | "assign"
8436 | "this"
8437 | "window"
8438 | "self"
8439 | "global"
8440 | "commonjs"
8441 | "commonjs2"
8442 | "commonjs-module"
8443 | "commonjs-static"
8444 | "amd"
8445 | "amd-require"
8446 | "umd"
8447 | "umd2"
8448 | "jsonp"
8449 | "system"
8450 | "promise"
8451 | "module-import"
8452 | "script"
8453 | "node-commonjs";
8454
8455 /**
8456 * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
8457 */
8458 remotes?: (string | RemotesObject)[] | RemotesObject;
8459
8460 /**
8461 * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
8462 */
8463 runtime?: string | false;
8464
8465 /**
8466 * Share scope name used for all shared modules (defaults to 'default').
8467 */
8468 shareScope?: string;
8469
8470 /**
8471 * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
8472 */
8473 shared?: (string | SharedObject)[] | SharedObject;
8474}
8475type ModuleFilterItemTypes =
8476 | string
8477 | RegExp
8478 | ((
8479 name: string,
8480 module: StatsModule,
8481 type: "module" | "chunk" | "root-of-chunk" | "nested"
8482 ) => boolean);
8483declare class ModuleGraph {
8484 constructor();
8485 setParents(
8486 dependency: Dependency,
8487 block: DependenciesBlock,
8488 module: Module,
8489 indexInBlock?: number
8490 ): void;
8491 getParentModule(dependency: Dependency): undefined | Module;
8492 getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
8493 getParentBlockIndex(dependency: Dependency): number;
8494 setResolvedModule(
8495 originModule: null | Module,
8496 dependency: Dependency,
8497 module: Module
8498 ): void;
8499 updateModule(dependency: Dependency, module: Module): void;
8500 removeConnection(dependency: Dependency): void;
8501 addExplanation(dependency: Dependency, explanation: string): void;
8502 cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
8503 removeModuleAttributes(module: Module): void;
8504 removeAllModuleAttributes(): void;
8505 moveModuleConnections(
8506 oldModule: Module,
8507 newModule: Module,
8508 filterConnection: (arg0: ModuleGraphConnection) => boolean
8509 ): void;
8510 copyOutgoingModuleConnections(
8511 oldModule: Module,
8512 newModule: Module,
8513 filterConnection: (arg0: ModuleGraphConnection) => boolean
8514 ): void;
8515 addExtraReason(module: Module, explanation: string): void;
8516 getResolvedModule(dependency: Dependency): null | Module;
8517 getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
8518 getModule(dependency: Dependency): null | Module;
8519 getOrigin(dependency: Dependency): null | Module;
8520 getResolvedOrigin(dependency: Dependency): null | Module;
8521 getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
8522 getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
8523 getIncomingConnectionsByOriginModule(
8524 module: Module
8525 ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
8526 getOutgoingConnectionsByModule(
8527 module: Module
8528 ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
8529 getProfile(module: Module): undefined | ModuleProfile;
8530 setProfile(module: Module, profile?: ModuleProfile): void;
8531 getIssuer(module: Module): undefined | null | Module;
8532 setIssuer(module: Module, issuer: null | Module): void;
8533 setIssuerIfUnset(module: Module, issuer: null | Module): void;
8534 getOptimizationBailout(
8535 module: Module
8536 ): (string | ((requestShortener: RequestShortener) => string))[];
8537 getProvidedExports(module: Module): null | true | string[];
8538 isExportProvided(
8539 module: Module,
8540 exportName: string | string[]
8541 ): null | boolean;
8542 getExportsInfo(module: Module): ExportsInfo;
8543 getExportInfo(module: Module, exportName: string): ExportInfo;
8544 getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
8545 getUsedExports(
8546 module: Module,
8547 runtime: RuntimeSpec
8548 ): null | boolean | SortableSet<string>;
8549 getPreOrderIndex(module: Module): null | number;
8550 getPostOrderIndex(module: Module): null | number;
8551 setPreOrderIndex(module: Module, index: number): void;
8552 setPreOrderIndexIfUnset(module: Module, index: number): boolean;
8553 setPostOrderIndex(module: Module, index: number): void;
8554 setPostOrderIndexIfUnset(module: Module, index: number): boolean;
8555 getDepth(module: Module): null | number;
8556 setDepth(module: Module, depth: number): void;
8557 setDepthIfLower(module: Module, depth: number): boolean;
8558 isAsync(module: Module): boolean;
8559 setAsync(module: Module): void;
8560 getMeta(thing?: any): object;
8561 getMetaIfExisting(thing?: any): undefined | object;
8562 freeze(cacheStage?: string): void;
8563 unfreeze(): void;
8564 cached<T extends any[], V>(
8565 fn: (moduleGraph: ModuleGraph, ...args: T) => V,
8566 ...args: T
8567 ): V;
8568 setModuleMemCaches(
8569 moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
8570 ): void;
8571 dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
8572 static getModuleGraphForModule(
8573 module: Module,
8574 deprecateMessage: string,
8575 deprecationCode: string
8576 ): ModuleGraph;
8577 static setModuleGraphForModule(
8578 module: Module,
8579 moduleGraph: ModuleGraph
8580 ): void;
8581 static clearModuleGraphForModule(module: Module): void;
8582 static ModuleGraphConnection: typeof ModuleGraphConnection;
8583}
8584declare class ModuleGraphConnection {
8585 constructor(
8586 originModule: null | Module,
8587 dependency: null | Dependency,
8588 module: Module,
8589 explanation?: string,
8590 weak?: boolean,
8591 condition?:
8592 | null
8593 | false
8594 | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
8595 );
8596 originModule: null | Module;
8597 resolvedOriginModule: null | Module;
8598 dependency: null | Dependency;
8599 resolvedModule: Module;
8600 module: Module;
8601 weak: boolean;
8602 conditional: boolean;
8603 condition?: (
8604 arg0: ModuleGraphConnection,
8605 arg1: RuntimeSpec
8606 ) => ConnectionState;
8607 explanations?: Set<string>;
8608 clone(): ModuleGraphConnection;
8609 addCondition(
8610 condition: (
8611 arg0: ModuleGraphConnection,
8612 arg1: RuntimeSpec
8613 ) => ConnectionState
8614 ): void;
8615 addExplanation(explanation: string): void;
8616 get explanation(): string;
8617 isActive(runtime: RuntimeSpec): boolean;
8618 isTargetActive(runtime: RuntimeSpec): boolean;
8619 getActiveState(runtime: RuntimeSpec): ConnectionState;
8620 setActive(value: boolean): void;
8621 active: void;
8622 static addConnectionStates: (
8623 a: ConnectionState,
8624 b: ConnectionState
8625 ) => ConnectionState;
8626 static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
8627 static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
8628}
8629type ModuleId = string | number;
8630type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
8631
8632/**
8633 * Options affecting the normal modules (`NormalModuleFactory`).
8634 */
8635declare interface ModuleOptions {
8636 /**
8637 * An array of rules applied by default for modules.
8638 */
8639 defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
8640
8641 /**
8642 * Enable warnings for full dynamic dependencies.
8643 */
8644 exprContextCritical?: boolean;
8645
8646 /**
8647 * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
8648 */
8649 exprContextRecursive?: boolean;
8650
8651 /**
8652 * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
8653 */
8654 exprContextRegExp?: boolean | RegExp;
8655
8656 /**
8657 * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
8658 */
8659 exprContextRequest?: string;
8660
8661 /**
8662 * Specify options for each generator.
8663 */
8664 generator?: GeneratorOptionsByModuleType;
8665
8666 /**
8667 * Don't parse files matching. It's matched against the full resolved request.
8668 */
8669 noParse?: string | Function | RegExp | (string | Function | RegExp)[];
8670
8671 /**
8672 * Specify options for each parser.
8673 */
8674 parser?: ParserOptionsByModuleType;
8675
8676 /**
8677 * An array of rules applied for modules.
8678 */
8679 rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
8680
8681 /**
8682 * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
8683 */
8684 strictExportPresence?: boolean;
8685
8686 /**
8687 * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
8688 */
8689 strictThisContextOnImports?: boolean;
8690
8691 /**
8692 * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
8693 */
8694 unknownContextCritical?: boolean;
8695
8696 /**
8697 * Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRecursive'.
8698 */
8699 unknownContextRecursive?: boolean;
8700
8701 /**
8702 * Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRegExp'.
8703 */
8704 unknownContextRegExp?: boolean | RegExp;
8705
8706 /**
8707 * Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRequest'.
8708 */
8709 unknownContextRequest?: string;
8710
8711 /**
8712 * Cache the resolving of module requests.
8713 */
8714 unsafeCache?: boolean | Function;
8715
8716 /**
8717 * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
8718 */
8719 wrappedContextCritical?: boolean;
8720
8721 /**
8722 * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
8723 */
8724 wrappedContextRecursive?: boolean;
8725
8726 /**
8727 * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
8728 */
8729 wrappedContextRegExp?: RegExp;
8730}
8731
8732/**
8733 * Options affecting the normal modules (`NormalModuleFactory`).
8734 */
8735declare interface ModuleOptionsNormalized {
8736 /**
8737 * An array of rules applied by default for modules.
8738 */
8739 defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
8740
8741 /**
8742 * Specify options for each generator.
8743 */
8744 generator: GeneratorOptionsByModuleType;
8745
8746 /**
8747 * Don't parse files matching. It's matched against the full resolved request.
8748 */
8749 noParse?: string | Function | RegExp | (string | Function | RegExp)[];
8750
8751 /**
8752 * Specify options for each parser.
8753 */
8754 parser: ParserOptionsByModuleType;
8755
8756 /**
8757 * An array of rules applied for modules.
8758 */
8759 rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
8760
8761 /**
8762 * Cache the resolving of module requests.
8763 */
8764 unsafeCache?: boolean | Function;
8765}
8766declare interface ModulePathData {
8767 id: string | number;
8768 hash: string;
8769 hashWithLength?: (arg0: number) => string;
8770}
8771declare abstract class ModuleProfile {
8772 startTime: number;
8773 factoryStartTime: number;
8774 factoryEndTime: number;
8775 factory: number;
8776 factoryParallelismFactor: number;
8777 restoringStartTime: number;
8778 restoringEndTime: number;
8779 restoring: number;
8780 restoringParallelismFactor: number;
8781 integrationStartTime: number;
8782 integrationEndTime: number;
8783 integration: number;
8784 integrationParallelismFactor: number;
8785 buildingStartTime: number;
8786 buildingEndTime: number;
8787 building: number;
8788 buildingParallelismFactor: number;
8789 storingStartTime: number;
8790 storingEndTime: number;
8791 storing: number;
8792 storingParallelismFactor: number;
8793 additionalFactoryTimes?: { start: number; end: number }[];
8794 additionalFactories: number;
8795 additionalFactoriesParallelismFactor: number;
8796 additionalIntegration: number;
8797 markFactoryStart(): void;
8798 markFactoryEnd(): void;
8799 markRestoringStart(): void;
8800 markRestoringEnd(): void;
8801 markIntegrationStart(): void;
8802 markIntegrationEnd(): void;
8803 markBuildingStart(): void;
8804 markBuildingEnd(): void;
8805 markStoringStart(): void;
8806 markStoringEnd(): void;
8807
8808 /**
8809 * Merge this profile into another one
8810 */
8811 mergeInto(realProfile: ModuleProfile): void;
8812}
8813declare interface ModuleReferenceOptions {
8814 /**
8815 * the properties/exports of the module
8816 */
8817 ids: string[];
8818
8819 /**
8820 * true, when this referenced export is called
8821 */
8822 call: boolean;
8823
8824 /**
8825 * true, when this referenced export is directly imported (not via property access)
8826 */
8827 directImport: boolean;
8828
8829 /**
8830 * if the position is ASI safe or unknown
8831 */
8832 asiSafe?: boolean;
8833}
8834declare interface ModuleResult {
8835 client: string;
8836 data: string;
8837 active: boolean;
8838}
8839declare interface ModuleSettings {
8840 /**
8841 * Specifies the layer in which the module should be placed in.
8842 */
8843 layer?: string;
8844
8845 /**
8846 * Module type to use for the module.
8847 */
8848 type?: string;
8849
8850 /**
8851 * Options for the resolver.
8852 */
8853 resolve?: ResolveOptions;
8854
8855 /**
8856 * Options for parsing.
8857 */
8858 parser?: { [index: string]: any };
8859
8860 /**
8861 * The options for the module generator.
8862 */
8863 generator?: { [index: string]: any };
8864
8865 /**
8866 * Flags a module as with or without side effects.
8867 */
8868 sideEffects?: boolean;
8869}
8870declare abstract class ModuleTemplate {
8871 type: string;
8872 hooks: Readonly<{
8873 content: {
8874 tap: <AdditionalOptions>(
8875 options:
8876 | string
8877 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8878 fn: (
8879 arg0: Source,
8880 arg1: Module,
8881 arg2: ChunkRenderContext,
8882 arg3: DependencyTemplates
8883 ) => Source
8884 ) => void;
8885 };
8886 module: {
8887 tap: <AdditionalOptions>(
8888 options:
8889 | string
8890 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8891 fn: (
8892 arg0: Source,
8893 arg1: Module,
8894 arg2: ChunkRenderContext,
8895 arg3: DependencyTemplates
8896 ) => Source
8897 ) => void;
8898 };
8899 render: {
8900 tap: <AdditionalOptions>(
8901 options:
8902 | string
8903 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8904 fn: (
8905 arg0: Source,
8906 arg1: Module,
8907 arg2: ChunkRenderContext,
8908 arg3: DependencyTemplates
8909 ) => Source
8910 ) => void;
8911 };
8912 package: {
8913 tap: <AdditionalOptions>(
8914 options:
8915 | string
8916 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8917 fn: (
8918 arg0: Source,
8919 arg1: Module,
8920 arg2: ChunkRenderContext,
8921 arg3: DependencyTemplates
8922 ) => Source
8923 ) => void;
8924 };
8925 hash: {
8926 tap: <AdditionalOptions>(
8927 options:
8928 | string
8929 | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
8930 fn: (arg0: Hash) => void
8931 ) => void;
8932 };
8933 }>;
8934 get runtimeTemplate(): RuntimeTemplate;
8935}
8936declare interface ModuleTemplates {
8937 javascript: ModuleTemplate;
8938}
8939declare class MultiCompiler {
8940 constructor(
8941 compilers: Compiler[] | Record<string, Compiler>,
8942 options: MultiCompilerOptions
8943 );
8944 hooks: Readonly<{
8945 done: SyncHook<[MultiStats]>;
8946 invalid: MultiHook<SyncHook<[null | string, number]>>;
8947 run: MultiHook<AsyncSeriesHook<[Compiler]>>;
8948 watchClose: SyncHook<[]>;
8949 watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
8950 infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
8951 }>;
8952 compilers: Compiler[];
8953 dependencies: WeakMap<Compiler, string[]>;
8954 running: boolean;
8955 get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
8956 get outputPath(): string;
8957 inputFileSystem: InputFileSystem;
8958 outputFileSystem: OutputFileSystem;
8959 watchFileSystem: WatchFileSystem;
8960 intermediateFileSystem: IntermediateFileSystem;
8961 getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
8962 setDependencies(compiler: Compiler, dependencies: string[]): void;
8963 validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
8964 runWithDependencies(
8965 compilers: Compiler[],
8966 fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
8967 callback: CallbackFunction_1<MultiStats>
8968 ): void;
8969 watch(
8970 watchOptions: WatchOptions | WatchOptions[],
8971 handler: CallbackFunction_1<MultiStats>
8972 ): MultiWatching;
8973 run(callback: CallbackFunction_1<MultiStats>): void;
8974 purgeInputFileSystem(): void;
8975 close(callback: CallbackFunction_1<void>): void;
8976}
8977declare interface MultiCompilerOptions {
8978 /**
8979 * how many Compilers are allows to run at the same time in parallel
8980 */
8981 parallelism?: number;
8982}
8983declare abstract class MultiStats {
8984 stats: Stats[];
8985 get hash(): string;
8986 hasErrors(): boolean;
8987 hasWarnings(): boolean;
8988 toJson(options?: string | boolean | StatsOptions): StatsCompilation;
8989 toString(options?: string | boolean | StatsOptions): string;
8990}
8991declare abstract class MultiWatching {
8992 watchings: Watching[];
8993 compiler: MultiCompiler;
8994 invalidate(callback?: CallbackFunction_2<void>): void;
8995 suspend(): void;
8996 resume(): void;
8997 close(callback: CallbackFunction_2<void>): void;
8998}
8999declare class NamedChunkIdsPlugin {
9000 constructor(options?: NamedChunkIdsPluginOptions);
9001 delimiter: string;
9002 context?: string;
9003
9004 /**
9005 * Apply the plugin
9006 */
9007 apply(compiler: Compiler): void;
9008}
9009declare interface NamedChunkIdsPluginOptions {
9010 /**
9011 * context
9012 */
9013 context?: string;
9014
9015 /**
9016 * delimiter
9017 */
9018 delimiter?: string;
9019}
9020declare class NamedModuleIdsPlugin {
9021 constructor(options?: NamedModuleIdsPluginOptions);
9022 options: NamedModuleIdsPluginOptions;
9023
9024 /**
9025 * Apply the plugin
9026 */
9027 apply(compiler: Compiler): void;
9028}
9029declare interface NamedModuleIdsPluginOptions {
9030 /**
9031 * context
9032 */
9033 context?: string;
9034}
9035declare class NaturalModuleIdsPlugin {
9036 constructor();
9037
9038 /**
9039 * Apply the plugin
9040 */
9041 apply(compiler: Compiler): void;
9042}
9043declare interface NeedBuildContext {
9044 compilation: Compilation;
9045 fileSystemInfo: FileSystemInfo;
9046 valueCacheVersions: Map<string, string | Set<string>>;
9047}
9048declare class NoEmitOnErrorsPlugin {
9049 constructor();
9050
9051 /**
9052 * Apply the plugin
9053 */
9054 apply(compiler: Compiler): void;
9055}
9056type Node = false | NodeOptions;
9057declare class NodeEnvironmentPlugin {
9058 constructor(options: {
9059 /**
9060 * infrastructure logging options
9061 */
9062 infrastructureLogging: InfrastructureLogging;
9063 });
9064 options: {
9065 /**
9066 * infrastructure logging options
9067 */
9068 infrastructureLogging: InfrastructureLogging;
9069 };
9070
9071 /**
9072 * Apply the plugin
9073 */
9074 apply(compiler: Compiler): void;
9075}
9076
9077/**
9078 * Options object for node compatibility features.
9079 */
9080declare interface NodeOptions {
9081 /**
9082 * Include a polyfill for the '__dirname' variable.
9083 */
9084 __dirname?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
9085
9086 /**
9087 * Include a polyfill for the '__filename' variable.
9088 */
9089 __filename?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
9090
9091 /**
9092 * Include a polyfill for the 'global' variable.
9093 */
9094 global?: boolean | "warn";
9095}
9096declare class NodeSourcePlugin {
9097 constructor();
9098
9099 /**
9100 * Apply the plugin
9101 */
9102 apply(compiler: Compiler): void;
9103}
9104declare class NodeTargetPlugin {
9105 constructor();
9106
9107 /**
9108 * Apply the plugin
9109 */
9110 apply(compiler: Compiler): void;
9111}
9112declare class NodeTemplatePlugin {
9113 constructor(options?: NodeTemplatePluginOptions);
9114
9115 /**
9116 * Apply the plugin
9117 */
9118 apply(compiler: Compiler): void;
9119}
9120declare interface NodeTemplatePluginOptions {
9121 /**
9122 * enable async chunk loading
9123 */
9124 asyncChunkLoading?: boolean;
9125}
9126declare class NormalModule extends Module {
9127 constructor(__0: NormalModuleCreateData);
9128 request: string;
9129 userRequest: string;
9130 rawRequest: string;
9131 binary: boolean;
9132 parser?: Parser;
9133 parserOptions?: ParserOptions;
9134 generator?: Generator;
9135 generatorOptions?: GeneratorOptions;
9136 resource: string;
9137 resourceResolveData?: Record<string, any>;
9138 matchResource?: string;
9139 loaders: LoaderItem[];
9140 error: null | WebpackError;
9141
9142 /**
9143 * restore unsafe cache data
9144 */
9145 restoreFromUnsafeCache(
9146 unsafeCacheData: NormalModuleUnsafeCacheData,
9147 normalModuleFactory: NormalModuleFactory
9148 ): void;
9149 createSourceForAsset(
9150 context: string,
9151 name: string,
9152 content: string | Buffer,
9153 sourceMap?: string | SourceMap,
9154 associatedObjectForCache?: object
9155 ): Source;
9156 getCurrentLoader(loaderContext?: any, index?: number): null | LoaderItem;
9157 createSource(
9158 context: string,
9159 content: string | Buffer,
9160 sourceMap?: null | string | SourceMapSource,
9161 associatedObjectForCache?: object
9162 ): Source;
9163 markModuleAsErrored(error: WebpackError): void;
9164 applyNoParseRule(rule: any, content: string): boolean;
9165 shouldPreventParsing(noParseRule: any, request: string): boolean;
9166 static getCompilationHooks(
9167 compilation: Compilation
9168 ): NormalModuleCompilationHooks;
9169 static deserialize(context?: any): NormalModule;
9170}
9171declare interface NormalModuleCompilationHooks {
9172 loader: SyncHook<[LoaderContextNormalModule<any>, NormalModule]>;
9173 beforeLoaders: SyncHook<
9174 [LoaderItem[], NormalModule, LoaderContextNormalModule<any>]
9175 >;
9176 beforeParse: SyncHook<[NormalModule]>;
9177 beforeSnapshot: SyncHook<[NormalModule]>;
9178 readResourceForScheme: HookMap<
9179 FakeHook<
9180 AsyncSeriesBailHook<[string, NormalModule], null | string | Buffer>
9181 >
9182 >;
9183 readResource: HookMap<
9184 AsyncSeriesBailHook<
9185 [LoaderContextNormalModule<any>],
9186 null | string | Buffer
9187 >
9188 >;
9189 needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
9190}
9191declare interface NormalModuleCreateData {
9192 /**
9193 * an optional layer in which the module is
9194 */
9195 layer?: string;
9196
9197 /**
9198 * module type. When deserializing, this is set to an empty string "".
9199 */
9200 type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
9201
9202 /**
9203 * request string
9204 */
9205 request: string;
9206
9207 /**
9208 * request intended by user (without loaders from config)
9209 */
9210 userRequest: string;
9211
9212 /**
9213 * request without resolving
9214 */
9215 rawRequest: string;
9216
9217 /**
9218 * list of loaders
9219 */
9220 loaders: LoaderItem[];
9221
9222 /**
9223 * path + query of the real resource
9224 */
9225 resource: string;
9226
9227 /**
9228 * resource resolve data
9229 */
9230 resourceResolveData?: Record<string, any>;
9231
9232 /**
9233 * context directory for resolving
9234 */
9235 context: string;
9236
9237 /**
9238 * path + query of the matched resource (virtual)
9239 */
9240 matchResource?: string;
9241
9242 /**
9243 * the parser used
9244 */
9245 parser: Parser;
9246
9247 /**
9248 * the options of the parser used
9249 */
9250 parserOptions?: ParserOptions;
9251
9252 /**
9253 * the generator used
9254 */
9255 generator: Generator;
9256
9257 /**
9258 * the options of the generator used
9259 */
9260 generatorOptions?: GeneratorOptions;
9261
9262 /**
9263 * options used for resolving requests from this module
9264 */
9265 resolveOptions?: ResolveOptions;
9266}
9267declare abstract class NormalModuleFactory extends ModuleFactory {
9268 hooks: Readonly<{
9269 resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
9270 resolveForScheme: HookMap<
9271 AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
9272 >;
9273 resolveInScheme: HookMap<
9274 AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
9275 >;
9276 factorize: AsyncSeriesBailHook<[ResolveData], undefined | Module>;
9277 beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
9278 afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
9279 createModule: AsyncSeriesBailHook<
9280 [
9281 Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
9282 ResolveData
9283 ],
9284 void | Module
9285 >;
9286 module: SyncWaterfallHook<
9287 [
9288 Module,
9289 Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
9290 ResolveData
9291 ],
9292 Module
9293 >;
9294 createParser: HookMap<SyncBailHook<[ParserOptions], Parser>>;
9295 parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
9296 createGenerator: HookMap<SyncBailHook<[GeneratorOptions], Generator>>;
9297 generator: HookMap<SyncBailHook<[any, GeneratorOptions], void>>;
9298 createModuleClass: HookMap<SyncBailHook<[any, ResolveData], Module>>;
9299 }>;
9300 resolverFactory: ResolverFactory;
9301 ruleSet: RuleSet;
9302 context: string;
9303 fs: InputFileSystem;
9304 parserCache: Map<string, WeakMap<object, Parser>>;
9305 generatorCache: Map<string, WeakMap<object, Generator>>;
9306 cleanupForCache(): void;
9307 resolveResource(
9308 contextInfo: ModuleFactoryCreateDataContextInfo,
9309 context: string,
9310 unresolvedResource: string,
9311 resolver: ResolverWithOptions,
9312 resolveContext: ResolveContext,
9313 callback: (
9314 err: null | Error,
9315 res?: string | false,
9316 req?: ResolveRequest
9317 ) => void
9318 ): void;
9319 resolveRequestArray(
9320 contextInfo: ModuleFactoryCreateDataContextInfo,
9321 context: string,
9322 array: LoaderItem[],
9323 resolver: ResolverWithOptions,
9324 resolveContext: ResolveContext,
9325 callback: CallbackNormalModuleFactory<LoaderItem[]>
9326 ): void;
9327 getParser(type: string, parserOptions?: ParserOptions): Parser;
9328 createParser(type: string, parserOptions?: ParserOptions): Parser;
9329 getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
9330 createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
9331 getResolver(
9332 type: string,
9333 resolveOptions?: ResolveOptionsWithDependencyType
9334 ): ResolverWithOptions;
9335}
9336
9337/**
9338 * These properties are added by the NormalModule
9339 */
9340declare interface NormalModuleLoaderContext<OptionsType> {
9341 version: number;
9342 getOptions(): OptionsType;
9343 getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
9344 emitWarning(warning: Error): void;
9345 emitError(error: Error): void;
9346 getLogger(name?: string): WebpackLogger;
9347 resolve(
9348 context: string,
9349 request: string,
9350 callback: (
9351 err: null | ErrorWithDetail,
9352 res?: string | false,
9353 req?: ResolveRequest
9354 ) => void
9355 ): any;
9356 getResolve(options?: ResolveOptionsWithDependencyType): {
9357 (
9358 context: string,
9359 request: string,
9360 callback: (
9361 err: null | ErrorWithDetail,
9362 res?: string | false,
9363 req?: ResolveRequest
9364 ) => void
9365 ): void;
9366 (context: string, request: string): Promise<string>;
9367 };
9368 emitFile(
9369 name: string,
9370 content: string | Buffer,
9371 sourceMap?: string,
9372 assetInfo?: AssetInfo
9373 ): void;
9374 addBuildDependency(dep: string): void;
9375 utils: {
9376 absolutify: (context: string, request: string) => string;
9377 contextify: (context: string, request: string) => string;
9378 createHash: (algorithm?: string | typeof Hash) => Hash;
9379 };
9380 rootContext: string;
9381 fs: InputFileSystem;
9382 sourceMap?: boolean;
9383 mode: "none" | "development" | "production";
9384 webpack?: boolean;
9385 hashFunction: HashFunction;
9386 hashDigest: string;
9387 hashDigestLength: number;
9388 hashSalt: string;
9389 _module?: NormalModule;
9390 _compilation?: Compilation;
9391 _compiler?: Compiler;
9392}
9393declare class NormalModuleReplacementPlugin {
9394 /**
9395 * Create an instance of the plugin
9396 */
9397 constructor(
9398 resourceRegExp: RegExp,
9399 newResource: string | ((arg0: ResolveData) => void)
9400 );
9401 resourceRegExp: RegExp;
9402 newResource: string | ((arg0: ResolveData) => void);
9403
9404 /**
9405 * Apply the plugin
9406 */
9407 apply(compiler: Compiler): void;
9408}
9409type NormalModuleUnsafeCacheData = UnsafeCacheData & {
9410 parser?: Parser;
9411 parserOptions?: ParserOptions;
9412 generator?: Generator;
9413 generatorOptions?: GeneratorOptions;
9414};
9415type NormalizedStatsOptions = KnownNormalizedStatsOptions &
9416 Omit<
9417 StatsOptions,
9418 | "context"
9419 | "chunkGroups"
9420 | "requestShortener"
9421 | "chunksSort"
9422 | "modulesSort"
9423 | "chunkModulesSort"
9424 | "nestedModulesSort"
9425 | "assetsSort"
9426 | "ids"
9427 | "cachedAssets"
9428 | "groupAssetsByEmitStatus"
9429 | "groupAssetsByPath"
9430 | "groupAssetsByExtension"
9431 | "assetsSpace"
9432 | "excludeAssets"
9433 | "excludeModules"
9434 | "warningsFilter"
9435 | "cachedModules"
9436 | "orphanModules"
9437 | "dependentModules"
9438 | "runtimeModules"
9439 | "groupModulesByCacheStatus"
9440 | "groupModulesByLayer"
9441 | "groupModulesByAttributes"
9442 | "groupModulesByPath"
9443 | "groupModulesByExtension"
9444 | "groupModulesByType"
9445 | "entrypoints"
9446 | "chunkGroupAuxiliary"
9447 | "chunkGroupChildren"
9448 | "chunkGroupMaxAssets"
9449 | "modulesSpace"
9450 | "chunkModulesSpace"
9451 | "nestedModulesSpace"
9452 | "logging"
9453 | "loggingDebug"
9454 | "loggingTrace"
9455 | "_env"
9456 > &
9457 Record<string, any>;
9458declare class NullDependency extends Dependency {
9459 constructor();
9460 static Template: typeof NullDependencyTemplate;
9461 static NO_EXPORTS_REFERENCED: string[][];
9462 static EXPORTS_OBJECT_REFERENCED: string[][];
9463 static TRANSITIVE: typeof TRANSITIVE;
9464}
9465declare class NullDependencyTemplate extends DependencyTemplate {
9466 constructor();
9467}
9468declare interface ObjectDeserializerContext {
9469 read: () => any;
9470 setCircularReference: (arg0?: any) => void;
9471}
9472declare interface ObjectEncodingOptions {
9473 encoding?:
9474 | null
9475 | "ascii"
9476 | "utf8"
9477 | "utf-8"
9478 | "utf16le"
9479 | "utf-16le"
9480 | "ucs2"
9481 | "ucs-2"
9482 | "latin1"
9483 | "binary"
9484 | "base64"
9485 | "base64url"
9486 | "hex";
9487}
9488declare interface ObjectForExtract {
9489 [index: string]: any;
9490}
9491declare interface ObjectSerializer {
9492 serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
9493 deserialize: (arg0: ObjectDeserializerContext) => any;
9494}
9495declare interface ObjectSerializerContext {
9496 write: (arg0?: any) => void;
9497 writeLazy?: (arg0?: any) => void;
9498 writeSeparate?: (arg0: any, arg1?: object) => () => any;
9499 setCircularReference: (arg0?: any) => void;
9500}
9501declare class OccurrenceChunkIdsPlugin {
9502 constructor(options?: OccurrenceChunkIdsPluginOptions);
9503 options: OccurrenceChunkIdsPluginOptions;
9504
9505 /**
9506 * Apply the plugin
9507 */
9508 apply(compiler: Compiler): void;
9509}
9510declare interface OccurrenceChunkIdsPluginOptions {
9511 /**
9512 * Prioritise initial size over total size.
9513 */
9514 prioritiseInitial?: boolean;
9515}
9516declare class OccurrenceModuleIdsPlugin {
9517 constructor(options?: OccurrenceModuleIdsPluginOptions);
9518 options: OccurrenceModuleIdsPluginOptions;
9519
9520 /**
9521 * Apply the plugin
9522 */
9523 apply(compiler: Compiler): void;
9524}
9525declare interface OccurrenceModuleIdsPluginOptions {
9526 /**
9527 * Prioritise initial size over total size.
9528 */
9529 prioritiseInitial?: boolean;
9530}
9531declare interface Open {
9532 (
9533 file: PathLikeFs,
9534 flags: undefined | string | number,
9535 mode: undefined | null | string | number,
9536 callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
9537 ): void;
9538 (
9539 file: PathLikeFs,
9540 flags: undefined | string | number,
9541 callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
9542 ): void;
9543 (
9544 file: PathLikeFs,
9545 callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
9546 ): void;
9547}
9548
9549/**
9550 * Enables/Disables integrated optimizations.
9551 */
9552declare interface Optimization {
9553 /**
9554 * Avoid wrapping the entry module in an IIFE.
9555 */
9556 avoidEntryIife?: boolean;
9557
9558 /**
9559 * Check for incompatible wasm types when importing/exporting from/to ESM.
9560 */
9561 checkWasmTypes?: boolean;
9562
9563 /**
9564 * Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash 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).
9565 */
9566 chunkIds?:
9567 | false
9568 | "natural"
9569 | "named"
9570 | "deterministic"
9571 | "size"
9572 | "total-size";
9573
9574 /**
9575 * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
9576 */
9577 concatenateModules?: boolean;
9578
9579 /**
9580 * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
9581 */
9582 emitOnErrors?: boolean;
9583
9584 /**
9585 * Also flag chunks as loaded which contain a subset of the modules.
9586 */
9587 flagIncludedChunks?: boolean;
9588
9589 /**
9590 * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
9591 */
9592 innerGraph?: boolean;
9593
9594 /**
9595 * Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/"deterministic": generate short deterministic names optimized for caching, "size": generate the shortest possible names).
9596 */
9597 mangleExports?: boolean | "deterministic" | "size";
9598
9599 /**
9600 * Reduce size of WASM by changing imports to shorter strings.
9601 */
9602 mangleWasmImports?: boolean;
9603
9604 /**
9605 * Merge chunks which contain the same modules.
9606 */
9607 mergeDuplicateChunks?: boolean;
9608
9609 /**
9610 * Enable minimizing the output. Uses optimization.minimizer.
9611 */
9612 minimize?: boolean;
9613
9614 /**
9615 * Minimizer(s) to use for minimizing the output.
9616 */
9617 minimizer?: (
9618 | undefined
9619 | null
9620 | false
9621 | ""
9622 | 0
9623 | ((this: Compiler, compiler: Compiler) => void)
9624 | WebpackPluginInstance
9625 | "..."
9626 )[];
9627
9628 /**
9629 * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).
9630 */
9631 moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
9632
9633 /**
9634 * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
9635 */
9636 noEmitOnErrors?: boolean;
9637
9638 /**
9639 * Set process.env.NODE_ENV to a specific value.
9640 */
9641 nodeEnv?: string | false;
9642
9643 /**
9644 * Generate records with relative paths to be able to move the context folder.
9645 */
9646 portableRecords?: boolean;
9647
9648 /**
9649 * Figure out which exports are provided by modules to generate more efficient code.
9650 */
9651 providedExports?: boolean;
9652
9653 /**
9654 * Use real [contenthash] based on final content of the assets.
9655 */
9656 realContentHash?: boolean;
9657
9658 /**
9659 * Removes modules from chunks when these modules are already included in all parents.
9660 */
9661 removeAvailableModules?: boolean;
9662
9663 /**
9664 * Remove chunks which are empty.
9665 */
9666 removeEmptyChunks?: boolean;
9667
9668 /**
9669 * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
9670 */
9671 runtimeChunk?:
9672 | boolean
9673 | "single"
9674 | "multiple"
9675 | {
9676 /**
9677 * The name or name factory for the runtime chunks.
9678 */
9679 name?: string | Function;
9680 };
9681
9682 /**
9683 * Skip over modules which contain no side effects when exports are not used (false: disabled, 'flag': only use manually placed side effects flag, true: also analyse source code for side effects).
9684 */
9685 sideEffects?: boolean | "flag";
9686
9687 /**
9688 * Optimize duplication and caching by splitting chunks by shared modules and cache group.
9689 */
9690 splitChunks?: false | OptimizationSplitChunksOptions;
9691
9692 /**
9693 * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, "global": analyse exports globally for all runtimes combined).
9694 */
9695 usedExports?: boolean | "global";
9696}
9697
9698/**
9699 * Options object for describing behavior of a cache group selecting modules that should be cached together.
9700 */
9701declare interface OptimizationSplitChunksCacheGroup {
9702 /**
9703 * Sets the name delimiter for created chunks.
9704 */
9705 automaticNameDelimiter?: string;
9706
9707 /**
9708 * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
9709 */
9710 chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
9711
9712 /**
9713 * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
9714 */
9715 enforce?: boolean;
9716
9717 /**
9718 * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
9719 */
9720 enforceSizeThreshold?: number | { [index: string]: number };
9721
9722 /**
9723 * Sets the template for the filename for created chunks.
9724 */
9725 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
9726
9727 /**
9728 * Sets the hint for chunk id.
9729 */
9730 idHint?: string;
9731
9732 /**
9733 * Assign modules to a cache group by module layer.
9734 */
9735 layer?: string | Function | RegExp;
9736
9737 /**
9738 * Maximum number of requests which are accepted for on-demand loading.
9739 */
9740 maxAsyncRequests?: number;
9741
9742 /**
9743 * Maximal size hint for the on-demand chunks.
9744 */
9745 maxAsyncSize?: number | { [index: string]: number };
9746
9747 /**
9748 * Maximum number of initial chunks which are accepted for an entry point.
9749 */
9750 maxInitialRequests?: number;
9751
9752 /**
9753 * Maximal size hint for the initial chunks.
9754 */
9755 maxInitialSize?: number | { [index: string]: number };
9756
9757 /**
9758 * Maximal size hint for the created chunks.
9759 */
9760 maxSize?: number | { [index: string]: number };
9761
9762 /**
9763 * Minimum number of times a module has to be duplicated until it's considered for splitting.
9764 */
9765 minChunks?: number;
9766
9767 /**
9768 * Minimal size for the chunks the stay after moving the modules to a new chunk.
9769 */
9770 minRemainingSize?: number | { [index: string]: number };
9771
9772 /**
9773 * Minimal size for the created chunk.
9774 */
9775 minSize?: number | { [index: string]: number };
9776
9777 /**
9778 * Minimum size reduction due to the created chunk.
9779 */
9780 minSizeReduction?: number | { [index: string]: number };
9781
9782 /**
9783 * Give chunks for this cache group a name (chunks with equal name are merged).
9784 */
9785 name?: string | false | Function;
9786
9787 /**
9788 * Priority of this cache group.
9789 */
9790 priority?: number;
9791
9792 /**
9793 * Try to reuse existing chunk (with name) when it has matching modules.
9794 */
9795 reuseExistingChunk?: boolean;
9796
9797 /**
9798 * Assign modules to a cache group by module name.
9799 */
9800 test?: string | Function | RegExp;
9801
9802 /**
9803 * Assign modules to a cache group by module type.
9804 */
9805 type?: string | Function | RegExp;
9806
9807 /**
9808 * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
9809 */
9810 usedExports?: boolean;
9811}
9812
9813/**
9814 * Options object for splitting chunks into smaller chunks.
9815 */
9816declare interface OptimizationSplitChunksOptions {
9817 /**
9818 * Sets the name delimiter for created chunks.
9819 */
9820 automaticNameDelimiter?: string;
9821
9822 /**
9823 * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
9824 */
9825 cacheGroups?: {
9826 [index: string]:
9827 | string
9828 | false
9829 | Function
9830 | RegExp
9831 | OptimizationSplitChunksCacheGroup;
9832 };
9833
9834 /**
9835 * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
9836 */
9837 chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
9838
9839 /**
9840 * Sets the size types which are used when a number is used for sizes.
9841 */
9842 defaultSizeTypes?: string[];
9843
9844 /**
9845 * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
9846 */
9847 enforceSizeThreshold?: number | { [index: string]: number };
9848
9849 /**
9850 * Options for modules not selected by any other cache group.
9851 */
9852 fallbackCacheGroup?: {
9853 /**
9854 * Sets the name delimiter for created chunks.
9855 */
9856 automaticNameDelimiter?: string;
9857 /**
9858 * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
9859 */
9860 chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
9861 /**
9862 * Maximal size hint for the on-demand chunks.
9863 */
9864 maxAsyncSize?: number | { [index: string]: number };
9865 /**
9866 * Maximal size hint for the initial chunks.
9867 */
9868 maxInitialSize?: number | { [index: string]: number };
9869 /**
9870 * Maximal size hint for the created chunks.
9871 */
9872 maxSize?: number | { [index: string]: number };
9873 /**
9874 * Minimal size for the created chunk.
9875 */
9876 minSize?: number | { [index: string]: number };
9877 /**
9878 * Minimum size reduction due to the created chunk.
9879 */
9880 minSizeReduction?: number | { [index: string]: number };
9881 };
9882
9883 /**
9884 * Sets the template for the filename for created chunks.
9885 */
9886 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
9887
9888 /**
9889 * Prevents exposing path info when creating names for parts splitted by maxSize.
9890 */
9891 hidePathInfo?: boolean;
9892
9893 /**
9894 * Maximum number of requests which are accepted for on-demand loading.
9895 */
9896 maxAsyncRequests?: number;
9897
9898 /**
9899 * Maximal size hint for the on-demand chunks.
9900 */
9901 maxAsyncSize?: number | { [index: string]: number };
9902
9903 /**
9904 * Maximum number of initial chunks which are accepted for an entry point.
9905 */
9906 maxInitialRequests?: number;
9907
9908 /**
9909 * Maximal size hint for the initial chunks.
9910 */
9911 maxInitialSize?: number | { [index: string]: number };
9912
9913 /**
9914 * Maximal size hint for the created chunks.
9915 */
9916 maxSize?: number | { [index: string]: number };
9917
9918 /**
9919 * Minimum number of times a module has to be duplicated until it's considered for splitting.
9920 */
9921 minChunks?: number;
9922
9923 /**
9924 * Minimal size for the chunks the stay after moving the modules to a new chunk.
9925 */
9926 minRemainingSize?: number | { [index: string]: number };
9927
9928 /**
9929 * Minimal size for the created chunks.
9930 */
9931 minSize?: number | { [index: string]: number };
9932
9933 /**
9934 * Minimum size reduction due to the created chunk.
9935 */
9936 minSizeReduction?: number | { [index: string]: number };
9937
9938 /**
9939 * Give chunks created a name (chunks with equal name are merged).
9940 */
9941 name?: string | false | Function;
9942
9943 /**
9944 * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
9945 */
9946 usedExports?: boolean;
9947}
9948declare interface Options {
9949 /**
9950 * source
9951 */
9952 source: string;
9953
9954 /**
9955 * absolute context path to which lib ident is relative to
9956 */
9957 context: string;
9958
9959 /**
9960 * content
9961 */
9962 content: DllReferencePluginOptionsContent;
9963
9964 /**
9965 * type
9966 */
9967 type?: "object" | "require";
9968
9969 /**
9970 * extensions
9971 */
9972 extensions?: string[];
9973
9974 /**
9975 * scope
9976 */
9977 scope?: string;
9978
9979 /**
9980 * object for caching
9981 */
9982 associatedObjectForCache?: object;
9983}
9984declare abstract class OptionsApply {
9985 process(options?: any, compiler?: any): void;
9986}
9987declare interface OriginRecord {
9988 module: null | Module;
9989 loc: DependencyLocation;
9990 request: string;
9991}
9992declare class OriginalSource extends Source {
9993 constructor(source: string | Buffer, name: string);
9994 getName(): string;
9995}
9996
9997/**
9998 * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
9999 */
10000declare interface Output {
10001 /**
10002 * Add a container for define/require functions in the AMD module.
10003 */
10004 amdContainer?: string;
10005
10006 /**
10007 * The filename of asset modules as relative path inside the 'output.path' directory.
10008 */
10009 assetModuleFilename?:
10010 | string
10011 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10012
10013 /**
10014 * Enable/disable creating async chunks that are loaded on demand.
10015 */
10016 asyncChunks?: boolean;
10017
10018 /**
10019 * Add a comment in the UMD wrapper.
10020 */
10021 auxiliaryComment?: string | LibraryCustomUmdCommentObject;
10022
10023 /**
10024 * Add charset attribute for script tag.
10025 */
10026 charset?: boolean;
10027
10028 /**
10029 * Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10030 */
10031 chunkFilename?:
10032 | string
10033 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10034
10035 /**
10036 * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
10037 */
10038 chunkFormat?: string | false;
10039
10040 /**
10041 * Number of milliseconds before chunk request expires.
10042 */
10043 chunkLoadTimeout?: number;
10044
10045 /**
10046 * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
10047 */
10048 chunkLoading?: string | false;
10049
10050 /**
10051 * The global variable used by webpack for loading of chunks.
10052 */
10053 chunkLoadingGlobal?: string;
10054
10055 /**
10056 * Clean the output directory before emit.
10057 */
10058 clean?: boolean | CleanOptions;
10059
10060 /**
10061 * Check if to be emitted file already exists and have the same content before writing to output filesystem.
10062 */
10063 compareBeforeEmit?: boolean;
10064
10065 /**
10066 * This option enables cross-origin loading of chunks.
10067 */
10068 crossOriginLoading?: false | "anonymous" | "use-credentials";
10069
10070 /**
10071 * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10072 */
10073 cssChunkFilename?:
10074 | string
10075 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10076
10077 /**
10078 * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10079 */
10080 cssFilename?:
10081 | string
10082 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10083
10084 /**
10085 * Compress the data in the head tag of CSS files.
10086 */
10087 cssHeadDataCompression?: boolean;
10088
10089 /**
10090 * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
10091 */
10092 devtoolFallbackModuleFilenameTemplate?: string | Function;
10093
10094 /**
10095 * Filename template string of function for the sources array in a generated SourceMap.
10096 */
10097 devtoolModuleFilenameTemplate?: string | Function;
10098
10099 /**
10100 * 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.
10101 */
10102 devtoolNamespace?: string;
10103
10104 /**
10105 * List of chunk loading types enabled for use by entry points.
10106 */
10107 enabledChunkLoadingTypes?: string[];
10108
10109 /**
10110 * List of library types enabled for use by entry points.
10111 */
10112 enabledLibraryTypes?: string[];
10113
10114 /**
10115 * List of wasm loading types enabled for use by entry points.
10116 */
10117 enabledWasmLoadingTypes?: string[];
10118
10119 /**
10120 * The abilities of the environment where the webpack generated code should run.
10121 */
10122 environment?: Environment;
10123
10124 /**
10125 * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10126 */
10127 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10128
10129 /**
10130 * An expression which is used to address the global object/scope in runtime code.
10131 */
10132 globalObject?: string;
10133
10134 /**
10135 * Digest type used for the hash.
10136 */
10137 hashDigest?: string;
10138
10139 /**
10140 * Number of chars which are used for the hash.
10141 */
10142 hashDigestLength?: number;
10143
10144 /**
10145 * Algorithm used for generation the hash (see node.js crypto package).
10146 */
10147 hashFunction?: string | typeof Hash;
10148
10149 /**
10150 * Any string which is added to the hash to salt it.
10151 */
10152 hashSalt?: string;
10153
10154 /**
10155 * The filename of the Hot Update Chunks. They are inside the output.path directory.
10156 */
10157 hotUpdateChunkFilename?: string;
10158
10159 /**
10160 * The global variable used by webpack for loading of hot update chunks.
10161 */
10162 hotUpdateGlobal?: string;
10163
10164 /**
10165 * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
10166 */
10167 hotUpdateMainFilename?: string;
10168
10169 /**
10170 * Ignore warnings in the browser.
10171 */
10172 ignoreBrowserWarnings?: boolean;
10173
10174 /**
10175 * Wrap javascript code into IIFE's to avoid leaking into global scope.
10176 */
10177 iife?: boolean;
10178
10179 /**
10180 * The name of the native import() function (can be exchanged for a polyfill).
10181 */
10182 importFunctionName?: string;
10183
10184 /**
10185 * The name of the native import.meta object (can be exchanged for a polyfill).
10186 */
10187 importMetaName?: string;
10188
10189 /**
10190 * Make the output files a library, exporting the exports of the entry point.
10191 */
10192 library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
10193
10194 /**
10195 * Specify which export should be exposed as library.
10196 */
10197 libraryExport?: string | string[];
10198
10199 /**
10200 * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
10201 */
10202 libraryTarget?: string;
10203
10204 /**
10205 * Output javascript files as module source type.
10206 */
10207 module?: boolean;
10208
10209 /**
10210 * The output directory as **absolute path** (required).
10211 */
10212 path?: string;
10213
10214 /**
10215 * Include comments with information about the modules.
10216 */
10217 pathinfo?: boolean | "verbose";
10218
10219 /**
10220 * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
10221 */
10222 publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10223
10224 /**
10225 * This option enables loading async chunks via a custom script type, such as script type="module".
10226 */
10227 scriptType?: false | "module" | "text/javascript";
10228
10229 /**
10230 * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
10231 */
10232 sourceMapFilename?: string;
10233
10234 /**
10235 * Prefixes every line of the source in the bundle with this string.
10236 */
10237 sourcePrefix?: string;
10238
10239 /**
10240 * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
10241 */
10242 strictModuleErrorHandling?: boolean;
10243
10244 /**
10245 * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
10246 */
10247 strictModuleExceptionHandling?: boolean;
10248
10249 /**
10250 * Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.
10251 */
10252 trustedTypes?: string | true | TrustedTypes;
10253
10254 /**
10255 * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
10256 */
10257 umdNamedDefine?: boolean;
10258
10259 /**
10260 * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
10261 */
10262 uniqueName?: string;
10263
10264 /**
10265 * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
10266 */
10267 wasmLoading?: string | false;
10268
10269 /**
10270 * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
10271 */
10272 webassemblyModuleFilename?: string;
10273
10274 /**
10275 * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
10276 */
10277 workerChunkLoading?: string | false;
10278
10279 /**
10280 * Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
10281 */
10282 workerPublicPath?: string;
10283
10284 /**
10285 * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
10286 */
10287 workerWasmLoading?: string | false;
10288}
10289declare interface OutputFileSystem {
10290 writeFile: WriteFile;
10291 mkdir: Mkdir;
10292 readdir?: ReaddirFs;
10293 rmdir?: Rmdir;
10294 unlink?: (
10295 arg0: PathLikeFs,
10296 arg1: (arg0: null | NodeJS.ErrnoException) => void
10297 ) => void;
10298 stat: StatFs;
10299 lstat?: LStatFs;
10300 readFile: ReadFileFs;
10301 join?: (arg0: string, arg1: string) => string;
10302 relative?: (arg0: string, arg1: string) => string;
10303 dirname?: (arg0: string) => string;
10304}
10305
10306/**
10307 * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
10308 */
10309declare interface OutputNormalized {
10310 /**
10311 * The filename of asset modules as relative path inside the 'output.path' directory.
10312 */
10313 assetModuleFilename?:
10314 | string
10315 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10316
10317 /**
10318 * Enable/disable creating async chunks that are loaded on demand.
10319 */
10320 asyncChunks?: boolean;
10321
10322 /**
10323 * Add charset attribute for script tag.
10324 */
10325 charset?: boolean;
10326
10327 /**
10328 * Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10329 */
10330 chunkFilename?:
10331 | string
10332 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10333
10334 /**
10335 * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
10336 */
10337 chunkFormat?: string | false;
10338
10339 /**
10340 * Number of milliseconds before chunk request expires.
10341 */
10342 chunkLoadTimeout?: number;
10343
10344 /**
10345 * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
10346 */
10347 chunkLoading?: string | false;
10348
10349 /**
10350 * The global variable used by webpack for loading of chunks.
10351 */
10352 chunkLoadingGlobal?: string;
10353
10354 /**
10355 * Clean the output directory before emit.
10356 */
10357 clean?: boolean | CleanOptions;
10358
10359 /**
10360 * Check if to be emitted file already exists and have the same content before writing to output filesystem.
10361 */
10362 compareBeforeEmit?: boolean;
10363
10364 /**
10365 * This option enables cross-origin loading of chunks.
10366 */
10367 crossOriginLoading?: false | "anonymous" | "use-credentials";
10368
10369 /**
10370 * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10371 */
10372 cssChunkFilename?:
10373 | string
10374 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10375
10376 /**
10377 * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10378 */
10379 cssFilename?:
10380 | string
10381 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10382
10383 /**
10384 * Compress the data in the head tag of CSS files.
10385 */
10386 cssHeadDataCompression?: boolean;
10387
10388 /**
10389 * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
10390 */
10391 devtoolFallbackModuleFilenameTemplate?: string | Function;
10392
10393 /**
10394 * Filename template string of function for the sources array in a generated SourceMap.
10395 */
10396 devtoolModuleFilenameTemplate?: string | Function;
10397
10398 /**
10399 * 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.
10400 */
10401 devtoolNamespace?: string;
10402
10403 /**
10404 * List of chunk loading types enabled for use by entry points.
10405 */
10406 enabledChunkLoadingTypes?: string[];
10407
10408 /**
10409 * List of library types enabled for use by entry points.
10410 */
10411 enabledLibraryTypes?: string[];
10412
10413 /**
10414 * List of wasm loading types enabled for use by entry points.
10415 */
10416 enabledWasmLoadingTypes?: string[];
10417
10418 /**
10419 * The abilities of the environment where the webpack generated code should run.
10420 */
10421 environment?: Environment;
10422
10423 /**
10424 * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
10425 */
10426 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10427
10428 /**
10429 * An expression which is used to address the global object/scope in runtime code.
10430 */
10431 globalObject?: string;
10432
10433 /**
10434 * Digest type used for the hash.
10435 */
10436 hashDigest?: string;
10437
10438 /**
10439 * Number of chars which are used for the hash.
10440 */
10441 hashDigestLength?: number;
10442
10443 /**
10444 * Algorithm used for generation the hash (see node.js crypto package).
10445 */
10446 hashFunction?: string | typeof Hash;
10447
10448 /**
10449 * Any string which is added to the hash to salt it.
10450 */
10451 hashSalt?: string;
10452
10453 /**
10454 * The filename of the Hot Update Chunks. They are inside the output.path directory.
10455 */
10456 hotUpdateChunkFilename?: string;
10457
10458 /**
10459 * The global variable used by webpack for loading of hot update chunks.
10460 */
10461 hotUpdateGlobal?: string;
10462
10463 /**
10464 * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
10465 */
10466 hotUpdateMainFilename?: string;
10467
10468 /**
10469 * Ignore warnings in the browser.
10470 */
10471 ignoreBrowserWarnings?: boolean;
10472
10473 /**
10474 * Wrap javascript code into IIFE's to avoid leaking into global scope.
10475 */
10476 iife?: boolean;
10477
10478 /**
10479 * The name of the native import() function (can be exchanged for a polyfill).
10480 */
10481 importFunctionName?: string;
10482
10483 /**
10484 * The name of the native import.meta object (can be exchanged for a polyfill).
10485 */
10486 importMetaName?: string;
10487
10488 /**
10489 * Options for library.
10490 */
10491 library?: LibraryOptions;
10492
10493 /**
10494 * Output javascript files as module source type.
10495 */
10496 module?: boolean;
10497
10498 /**
10499 * The output directory as **absolute path** (required).
10500 */
10501 path?: string;
10502
10503 /**
10504 * Include comments with information about the modules.
10505 */
10506 pathinfo?: boolean | "verbose";
10507
10508 /**
10509 * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
10510 */
10511 publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
10512
10513 /**
10514 * This option enables loading async chunks via a custom script type, such as script type="module".
10515 */
10516 scriptType?: false | "module" | "text/javascript";
10517
10518 /**
10519 * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
10520 */
10521 sourceMapFilename?: string;
10522
10523 /**
10524 * Prefixes every line of the source in the bundle with this string.
10525 */
10526 sourcePrefix?: string;
10527
10528 /**
10529 * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
10530 */
10531 strictModuleErrorHandling?: boolean;
10532
10533 /**
10534 * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
10535 */
10536 strictModuleExceptionHandling?: boolean;
10537
10538 /**
10539 * Use a Trusted Types policy to create urls for chunks.
10540 */
10541 trustedTypes?: TrustedTypes;
10542
10543 /**
10544 * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
10545 */
10546 uniqueName?: string;
10547
10548 /**
10549 * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
10550 */
10551 wasmLoading?: string | false;
10552
10553 /**
10554 * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
10555 */
10556 webassemblyModuleFilename?: string;
10557
10558 /**
10559 * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
10560 */
10561 workerChunkLoading?: string | false;
10562
10563 /**
10564 * Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
10565 */
10566 workerPublicPath?: string;
10567
10568 /**
10569 * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
10570 */
10571 workerWasmLoading?: string | false;
10572}
10573declare interface ParameterizedComparator<TArg, T> {
10574 (arg0: TArg): Comparator<T>;
10575}
10576declare interface ParsedIdentifier {
10577 request: string;
10578 query: string;
10579 fragment: string;
10580 directory: boolean;
10581 module: boolean;
10582 file: boolean;
10583 internal: boolean;
10584}
10585declare class Parser {
10586 constructor();
10587 parse(
10588 source: string | Buffer | PreparsedAst,
10589 state: ParserState
10590 ): ParserState;
10591}
10592declare interface ParserOptions {
10593 [index: string]: any;
10594}
10595type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
10596 ParserOptionsByModuleTypeUnknown;
10597
10598/**
10599 * Specify options for each parser.
10600 */
10601declare interface ParserOptionsByModuleTypeKnown {
10602 /**
10603 * Parser options for asset modules.
10604 */
10605 asset?: AssetParserOptions;
10606
10607 /**
10608 * No parser options are supported for this module type.
10609 */
10610 "asset/inline"?: EmptyParserOptions;
10611
10612 /**
10613 * No parser options are supported for this module type.
10614 */
10615 "asset/resource"?: EmptyParserOptions;
10616
10617 /**
10618 * No parser options are supported for this module type.
10619 */
10620 "asset/source"?: EmptyParserOptions;
10621
10622 /**
10623 * Parser options for css modules.
10624 */
10625 css?: CssParserOptions;
10626
10627 /**
10628 * Parser options for css/auto modules.
10629 */
10630 "css/auto"?: CssAutoParserOptions;
10631
10632 /**
10633 * Parser options for css/global modules.
10634 */
10635 "css/global"?: CssGlobalParserOptions;
10636
10637 /**
10638 * Parser options for css/module modules.
10639 */
10640 "css/module"?: CssModuleParserOptions;
10641
10642 /**
10643 * Parser options for javascript modules.
10644 */
10645 javascript?: JavascriptParserOptions;
10646
10647 /**
10648 * Parser options for javascript modules.
10649 */
10650 "javascript/auto"?: JavascriptParserOptions;
10651
10652 /**
10653 * Parser options for javascript modules.
10654 */
10655 "javascript/dynamic"?: JavascriptParserOptions;
10656
10657 /**
10658 * Parser options for javascript modules.
10659 */
10660 "javascript/esm"?: JavascriptParserOptions;
10661}
10662
10663/**
10664 * Specify options for each parser.
10665 */
10666declare interface ParserOptionsByModuleTypeUnknown {
10667 [index: string]: { [index: string]: any };
10668}
10669type ParserState = Record<string, any> & ParserStateBase;
10670declare interface ParserStateBase {
10671 source: string | Buffer;
10672 current: NormalModule;
10673 module: NormalModule;
10674 compilation: Compilation;
10675 options: { [index: string]: any };
10676}
10677declare interface PathData {
10678 chunkGraph?: ChunkGraph;
10679 hash?: string;
10680 hashWithLength?: (arg0: number) => string;
10681 chunk?: Chunk | ChunkPathData;
10682 module?: Module | ModulePathData;
10683 runtime?: RuntimeSpec;
10684 filename?: string;
10685 basename?: string;
10686 query?: string;
10687 contentHashType?: string;
10688 contentHash?: string;
10689 contentHashWithLength?: (arg0: number) => string;
10690 noChunkHash?: boolean;
10691 url?: string;
10692}
10693type PathLikeFs = string | Buffer | URL;
10694type PathLikeTypes = string | Buffer | URL_url;
10695type PathOrFileDescriptorFs = string | number | Buffer | URL;
10696type PathOrFileDescriptorTypes = string | number | Buffer | URL_url;
10697type Pattern =
10698 | Identifier
10699 | MemberExpression
10700 | ObjectPattern
10701 | ArrayPattern
10702 | RestElement
10703 | AssignmentPattern;
10704
10705/**
10706 * Configuration object for web performance recommendations.
10707 */
10708declare interface PerformanceOptions {
10709 /**
10710 * Filter function to select assets that are checked.
10711 */
10712 assetFilter?: Function;
10713
10714 /**
10715 * Sets the format of the hints: warnings, errors or nothing at all.
10716 */
10717 hints?: false | "error" | "warning";
10718
10719 /**
10720 * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
10721 */
10722 maxAssetSize?: number;
10723
10724 /**
10725 * Total size of an entry point (in bytes).
10726 */
10727 maxEntrypointSize?: number;
10728}
10729declare interface PitchLoaderDefinitionFunction<
10730 OptionsType = {},
10731 ContextAdditions = {}
10732> {
10733 (
10734 this: NormalModuleLoaderContext<OptionsType> &
10735 LoaderRunnerLoaderContext<OptionsType> &
10736 LoaderPluginLoaderContext &
10737 HotModuleReplacementPluginLoaderContext &
10738 ContextAdditions,
10739 remainingRequest: string,
10740 previousRequest: string,
10741 data: object
10742 ): string | void | Buffer | Promise<string | Buffer>;
10743}
10744declare class PlatformPlugin {
10745 constructor(platform: Partial<PlatformTargetProperties>);
10746 platform: Partial<PlatformTargetProperties>;
10747
10748 /**
10749 * Apply the plugin
10750 */
10751 apply(compiler: Compiler): void;
10752}
10753declare interface PlatformTargetProperties {
10754 /**
10755 * web platform, importing of http(s) and std: is available
10756 */
10757 web: null | boolean;
10758
10759 /**
10760 * browser platform, running in a normal web browser
10761 */
10762 browser: null | boolean;
10763
10764 /**
10765 * (Web)Worker platform, running in a web/shared/service worker
10766 */
10767 webworker: null | boolean;
10768
10769 /**
10770 * node platform, require of node built-in modules is available
10771 */
10772 node: null | boolean;
10773
10774 /**
10775 * nwjs platform, require of legacy nw.gui is available
10776 */
10777 nwjs: null | boolean;
10778
10779 /**
10780 * electron platform, require of some electron built-in modules is available
10781 */
10782 electron: null | boolean;
10783}
10784type Plugin =
10785 | undefined
10786 | null
10787 | false
10788 | ""
10789 | 0
10790 | { apply: (arg0: Resolver) => void }
10791 | ((this: Resolver, arg1: Resolver) => void);
10792declare interface PnpApi {
10793 resolveToUnqualified: (
10794 arg0: string,
10795 arg1: string,
10796 arg2: object
10797 ) => null | string;
10798}
10799declare class PrefetchPlugin {
10800 constructor(context: string, request?: string);
10801 context: null | string;
10802 request: string;
10803
10804 /**
10805 * Apply the plugin
10806 */
10807 apply(compiler: Compiler): void;
10808}
10809declare class PrefixSource extends Source {
10810 constructor(prefix: string, source: string | Source);
10811 original(): Source;
10812 getPrefix(): string;
10813}
10814declare interface PreparsedAst {
10815 [index: string]: any;
10816}
10817declare interface PrintedElement {
10818 element: string;
10819 content: string;
10820}
10821declare interface Problem {
10822 type: ProblemType;
10823 path: string;
10824 argument: string;
10825 value?: any;
10826 index?: number;
10827 expected?: string;
10828}
10829type ProblemType =
10830 | "unknown-argument"
10831 | "unexpected-non-array-in-path"
10832 | "unexpected-non-object-in-path"
10833 | "multiple-values-unexpected"
10834 | "invalid-value";
10835declare interface ProcessAssetsAdditionalOptions {
10836 additionalAssets?: true | Function;
10837}
10838declare class Profiler {
10839 constructor(inspector?: any);
10840 session: any;
10841 inspector: any;
10842 hasSession(): boolean;
10843 startProfiling(): Promise<void> | Promise<[any, any, any]>;
10844 sendCommand(method: string, params?: object): Promise<any>;
10845 destroy(): Promise<void>;
10846 stopProfiling(): Promise<{ profile: any }>;
10847}
10848declare class ProfilingPlugin {
10849 constructor(options?: ProfilingPluginOptions);
10850 outputPath: string;
10851
10852 /**
10853 * Apply the plugin
10854 */
10855 apply(compiler: Compiler): void;
10856 static Profiler: typeof Profiler;
10857}
10858declare interface ProfilingPluginOptions {
10859 /**
10860 * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
10861 */
10862 outputPath?: string;
10863}
10864declare class ProgressPlugin {
10865 constructor(options?: ProgressPluginArgument);
10866 profile?: null | boolean;
10867 handler?: (percentage: number, msg: string, ...args: string[]) => void;
10868 modulesCount?: number;
10869 dependenciesCount?: number;
10870 showEntries?: boolean;
10871 showModules?: boolean;
10872 showDependencies?: boolean;
10873 showActiveModules?: boolean;
10874 percentBy?: null | "entries" | "modules" | "dependencies";
10875 apply(compiler: Compiler | MultiCompiler): void;
10876 static getReporter(
10877 compiler: Compiler
10878 ): undefined | ((p: number, ...args: string[]) => void);
10879 static defaultOptions: {
10880 profile: boolean;
10881 modulesCount: number;
10882 dependenciesCount: number;
10883 modules: boolean;
10884 dependencies: boolean;
10885 activeModules: boolean;
10886 entries: boolean;
10887 };
10888 static createDefaultHandler: (
10889 profile: undefined | null | boolean,
10890 logger: WebpackLogger
10891 ) => (percentage: number, msg: string, ...args: string[]) => void;
10892}
10893type ProgressPluginArgument =
10894 | ProgressPluginOptions
10895 | ((percentage: number, msg: string, ...args: string[]) => void);
10896
10897/**
10898 * Options object for the ProgressPlugin.
10899 */
10900declare interface ProgressPluginOptions {
10901 /**
10902 * Show active modules count and one active module in progress message.
10903 */
10904 activeModules?: boolean;
10905
10906 /**
10907 * Show dependencies count in progress message.
10908 */
10909 dependencies?: boolean;
10910
10911 /**
10912 * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
10913 */
10914 dependenciesCount?: number;
10915
10916 /**
10917 * Show entries count in progress message.
10918 */
10919 entries?: boolean;
10920
10921 /**
10922 * Function that executes for every progress step.
10923 */
10924 handler?: (percentage: number, msg: string, ...args: string[]) => void;
10925
10926 /**
10927 * Show modules count in progress message.
10928 */
10929 modules?: boolean;
10930
10931 /**
10932 * Minimum modules count to start with. For better progress calculation. Default: 5000.
10933 */
10934 modulesCount?: number;
10935
10936 /**
10937 * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
10938 */
10939 percentBy?: null | "entries" | "modules" | "dependencies";
10940
10941 /**
10942 * Collect profile data for progress steps. Default: false.
10943 */
10944 profile?: null | boolean;
10945}
10946declare class ProvidePlugin {
10947 constructor(definitions: Record<string, string | string[]>);
10948 definitions: Record<string, string | string[]>;
10949
10950 /**
10951 * Apply the plugin
10952 */
10953 apply(compiler: Compiler): void;
10954}
10955declare class ProvideSharedPlugin {
10956 constructor(options: ProvideSharedPluginOptions);
10957
10958 /**
10959 * Apply the plugin
10960 */
10961 apply(compiler: Compiler): void;
10962}
10963declare interface ProvideSharedPluginOptions {
10964 /**
10965 * Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.
10966 */
10967 provides: Provides;
10968
10969 /**
10970 * Share scope name used for all provided modules (defaults to 'default').
10971 */
10972 shareScope?: string;
10973}
10974type Provides = (string | ProvidesObject)[] | ProvidesObject;
10975
10976/**
10977 * Advanced configuration for modules that should be provided as shared modules to the share scope.
10978 */
10979declare interface ProvidesConfig {
10980 /**
10981 * Include the provided module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
10982 */
10983 eager?: boolean;
10984
10985 /**
10986 * Key in the share scope under which the shared modules should be stored.
10987 */
10988 shareKey?: string;
10989
10990 /**
10991 * Share scope name.
10992 */
10993 shareScope?: string;
10994
10995 /**
10996 * Version of the provided module. Will replace lower matching versions, but not higher.
10997 */
10998 version?: string | false;
10999}
11000
11001/**
11002 * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
11003 */
11004declare interface ProvidesObject {
11005 [index: string]: string | ProvidesConfig;
11006}
11007declare interface RawChunkGroupOptions {
11008 preloadOrder?: number;
11009 prefetchOrder?: number;
11010 fetchPriority?: "auto" | "low" | "high";
11011}
11012type RawLoaderDefinition<
11013 OptionsType = {},
11014 ContextAdditions = {}
11015> = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
11016 raw: true;
11017 pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
11018};
11019declare interface RawLoaderDefinitionFunction<
11020 OptionsType = {},
11021 ContextAdditions = {}
11022> {
11023 (
11024 this: NormalModuleLoaderContext<OptionsType> &
11025 LoaderRunnerLoaderContext<OptionsType> &
11026 LoaderPluginLoaderContext &
11027 HotModuleReplacementPluginLoaderContext &
11028 ContextAdditions,
11029 content: Buffer,
11030 sourceMap?: string | SourceMap,
11031 additionalData?: AdditionalData
11032 ): string | void | Buffer | Promise<string | Buffer>;
11033}
11034declare class RawSource extends Source {
11035 constructor(source: string | Buffer, convertToString?: boolean);
11036 isBuffer(): boolean;
11037}
11038declare interface RawSourceMap {
11039 version: number;
11040 sources: string[];
11041 names: string[];
11042 sourceRoot?: string;
11043 sourcesContent?: string[];
11044 mappings: string;
11045 file: string;
11046}
11047declare interface Read<TBuffer extends ArrayBufferView = Buffer> {
11048 (
11049 fd: number,
11050 buffer: TBuffer,
11051 offset: number,
11052 length: number,
11053 position: null | number | bigint,
11054 callback: (
11055 err: null | NodeJS.ErrnoException,
11056 bytesRead: number,
11057 buffer: TBuffer
11058 ) => void
11059 ): void;
11060 (
11061 fd: number,
11062 options: ReadAsyncOptions<TBuffer>,
11063 callback: (
11064 err: null | NodeJS.ErrnoException,
11065 bytesRead: number,
11066 buffer: TBuffer
11067 ) => void
11068 ): void;
11069 (
11070 fd: number,
11071 callback: (
11072 err: null | NodeJS.ErrnoException,
11073 bytesRead: number,
11074 buffer: ArrayBufferView
11075 ) => void
11076 ): void;
11077}
11078declare interface ReadAsyncOptions<TBuffer extends ArrayBufferView> {
11079 offset?: number;
11080 length?: number;
11081 position?: null | number | bigint;
11082 buffer?: TBuffer;
11083}
11084declare class ReadFileCompileWasmPlugin {
11085 constructor(options?: ReadFileCompileWasmPluginOptions);
11086 options: ReadFileCompileWasmPluginOptions;
11087
11088 /**
11089 * Apply the plugin
11090 */
11091 apply(compiler: Compiler): void;
11092}
11093declare interface ReadFileCompileWasmPluginOptions {
11094 /**
11095 * mangle imports
11096 */
11097 mangleImports?: boolean;
11098}
11099declare interface ReadFileFs {
11100 (
11101 path: PathOrFileDescriptorFs,
11102 options:
11103 | undefined
11104 | null
11105 | ({ encoding?: null; flag?: string } & Abortable),
11106 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11107 ): void;
11108 (
11109 path: PathOrFileDescriptorFs,
11110 options:
11111 | "ascii"
11112 | "utf8"
11113 | "utf-8"
11114 | "utf16le"
11115 | "utf-16le"
11116 | "ucs2"
11117 | "ucs-2"
11118 | "latin1"
11119 | "binary"
11120 | ({ encoding: BufferEncoding; flag?: string } & Abortable)
11121 | "base64"
11122 | "base64url"
11123 | "hex",
11124 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11125 ): void;
11126 (
11127 path: PathOrFileDescriptorFs,
11128 options:
11129 | undefined
11130 | null
11131 | "ascii"
11132 | "utf8"
11133 | "utf-8"
11134 | "utf16le"
11135 | "utf-16le"
11136 | "ucs2"
11137 | "ucs-2"
11138 | "latin1"
11139 | "binary"
11140 | "base64"
11141 | "base64url"
11142 | "hex"
11143 | (ObjectEncodingOptions & { flag?: string } & Abortable),
11144 callback: (
11145 arg0: null | NodeJS.ErrnoException,
11146 arg1?: string | Buffer
11147 ) => void
11148 ): void;
11149 (
11150 path: PathOrFileDescriptorFs,
11151 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11152 ): void;
11153}
11154declare interface ReadFileSync {
11155 (
11156 path: PathOrFileDescriptorFs,
11157 options?: null | { encoding?: null; flag?: string }
11158 ): Buffer;
11159 (
11160 path: PathOrFileDescriptorFs,
11161 options:
11162 | "ascii"
11163 | "utf8"
11164 | "utf-8"
11165 | "utf16le"
11166 | "utf-16le"
11167 | "ucs2"
11168 | "ucs-2"
11169 | "latin1"
11170 | "binary"
11171 | "base64"
11172 | "base64url"
11173 | "hex"
11174 | { encoding: BufferEncoding; flag?: string }
11175 ): string;
11176 (
11177 path: PathOrFileDescriptorFs,
11178 options?:
11179 | null
11180 | "ascii"
11181 | "utf8"
11182 | "utf-8"
11183 | "utf16le"
11184 | "utf-16le"
11185 | "ucs2"
11186 | "ucs-2"
11187 | "latin1"
11188 | "binary"
11189 | "base64"
11190 | "base64url"
11191 | "hex"
11192 | (ObjectEncodingOptions & { flag?: string })
11193 ): string | Buffer;
11194}
11195declare interface ReadFileTypes {
11196 (
11197 path: PathOrFileDescriptorTypes,
11198 options:
11199 | undefined
11200 | null
11201 | ({ encoding?: null; flag?: string } & Abortable),
11202 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11203 ): void;
11204 (
11205 path: PathOrFileDescriptorTypes,
11206 options:
11207 | "ascii"
11208 | "utf8"
11209 | "utf-8"
11210 | "utf16le"
11211 | "utf-16le"
11212 | "ucs2"
11213 | "ucs-2"
11214 | "latin1"
11215 | "binary"
11216 | "base64"
11217 | "base64url"
11218 | "hex"
11219 | ({ encoding: BufferEncoding; flag?: string } & Abortable),
11220 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11221 ): void;
11222 (
11223 path: PathOrFileDescriptorTypes,
11224 options:
11225 | undefined
11226 | null
11227 | "ascii"
11228 | "utf8"
11229 | "utf-8"
11230 | "utf16le"
11231 | "utf-16le"
11232 | "ucs2"
11233 | "ucs-2"
11234 | "latin1"
11235 | "binary"
11236 | "base64"
11237 | "base64url"
11238 | "hex"
11239 | (ObjectEncodingOptions & { flag?: string } & Abortable),
11240 callback: (
11241 arg0: null | NodeJS.ErrnoException,
11242 arg1?: string | Buffer
11243 ) => void
11244 ): void;
11245 (
11246 path: PathOrFileDescriptorTypes,
11247 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11248 ): void;
11249}
11250declare interface ReaddirFs {
11251 (
11252 path: PathLikeFs,
11253 options:
11254 | undefined
11255 | null
11256 | "ascii"
11257 | "utf8"
11258 | "utf-8"
11259 | "utf16le"
11260 | "utf-16le"
11261 | "ucs2"
11262 | "ucs-2"
11263 | "latin1"
11264 | "binary"
11265 | "base64"
11266 | "base64url"
11267 | "hex"
11268 | {
11269 encoding:
11270 | null
11271 | "ascii"
11272 | "utf8"
11273 | "utf-8"
11274 | "utf16le"
11275 | "utf-16le"
11276 | "ucs2"
11277 | "ucs-2"
11278 | "latin1"
11279 | "binary"
11280 | "base64"
11281 | "base64url"
11282 | "hex";
11283 withFileTypes?: false;
11284 recursive?: boolean;
11285 },
11286 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
11287 ): void;
11288 (
11289 path: PathLikeFs,
11290 options:
11291 | "buffer"
11292 | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
11293 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
11294 ): void;
11295 (
11296 path: PathLikeFs,
11297 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
11298 ): void;
11299 (
11300 path: PathLikeFs,
11301 options:
11302 | undefined
11303 | null
11304 | "ascii"
11305 | "utf8"
11306 | "utf-8"
11307 | "utf16le"
11308 | "utf-16le"
11309 | "ucs2"
11310 | "ucs-2"
11311 | "latin1"
11312 | "binary"
11313 | "base64"
11314 | "base64url"
11315 | "hex"
11316 | (ObjectEncodingOptions & {
11317 withFileTypes?: false;
11318 recursive?: boolean;
11319 }),
11320 callback: (
11321 arg0: null | NodeJS.ErrnoException,
11322 arg1?: string[] | Buffer[]
11323 ) => void
11324 ): void;
11325 (
11326 path: PathLikeFs,
11327 options: ObjectEncodingOptions & {
11328 withFileTypes: true;
11329 recursive?: boolean;
11330 },
11331 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
11332 ): void;
11333}
11334declare interface ReaddirSync {
11335 (
11336 path: PathLikeFs,
11337 options?:
11338 | null
11339 | "ascii"
11340 | "utf8"
11341 | "utf-8"
11342 | "utf16le"
11343 | "utf-16le"
11344 | "ucs2"
11345 | "ucs-2"
11346 | "latin1"
11347 | "binary"
11348 | "base64"
11349 | "base64url"
11350 | "hex"
11351 | {
11352 encoding:
11353 | null
11354 | "ascii"
11355 | "utf8"
11356 | "utf-8"
11357 | "utf16le"
11358 | "utf-16le"
11359 | "ucs2"
11360 | "ucs-2"
11361 | "latin1"
11362 | "binary"
11363 | "base64"
11364 | "base64url"
11365 | "hex";
11366 withFileTypes?: false;
11367 recursive?: boolean;
11368 }
11369 ): string[];
11370 (
11371 path: PathLikeFs,
11372 options:
11373 | "buffer"
11374 | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }
11375 ): Buffer[];
11376 (
11377 path: PathLikeFs,
11378 options?:
11379 | null
11380 | "ascii"
11381 | "utf8"
11382 | "utf-8"
11383 | "utf16le"
11384 | "utf-16le"
11385 | "ucs2"
11386 | "ucs-2"
11387 | "latin1"
11388 | "binary"
11389 | "base64"
11390 | "base64url"
11391 | "hex"
11392 | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
11393 ): string[] | Buffer[];
11394 (
11395 path: PathLikeFs,
11396 options: ObjectEncodingOptions & {
11397 withFileTypes: true;
11398 recursive?: boolean;
11399 }
11400 ): Dirent[];
11401}
11402declare interface ReaddirTypes {
11403 (
11404 path: PathLikeTypes,
11405 options:
11406 | undefined
11407 | null
11408 | "ascii"
11409 | "utf8"
11410 | "utf-8"
11411 | "utf16le"
11412 | "utf-16le"
11413 | "ucs2"
11414 | "ucs-2"
11415 | "latin1"
11416 | "binary"
11417 | "base64"
11418 | "base64url"
11419 | "hex"
11420 | {
11421 encoding:
11422 | null
11423 | "ascii"
11424 | "utf8"
11425 | "utf-8"
11426 | "utf16le"
11427 | "utf-16le"
11428 | "ucs2"
11429 | "ucs-2"
11430 | "latin1"
11431 | "binary"
11432 | "base64"
11433 | "base64url"
11434 | "hex";
11435 withFileTypes?: false;
11436 recursive?: boolean;
11437 },
11438 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
11439 ): void;
11440 (
11441 path: PathLikeTypes,
11442 options:
11443 | "buffer"
11444 | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
11445 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
11446 ): void;
11447 (
11448 path: PathLikeTypes,
11449 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
11450 ): void;
11451 (
11452 path: PathLikeTypes,
11453 options:
11454 | undefined
11455 | null
11456 | "ascii"
11457 | "utf8"
11458 | "utf-8"
11459 | "utf16le"
11460 | "utf-16le"
11461 | "ucs2"
11462 | "ucs-2"
11463 | "latin1"
11464 | "binary"
11465 | "base64"
11466 | "base64url"
11467 | "hex"
11468 | (ObjectEncodingOptions & {
11469 withFileTypes?: false;
11470 recursive?: boolean;
11471 }),
11472 callback: (
11473 arg0: null | NodeJS.ErrnoException,
11474 arg1?: string[] | Buffer[]
11475 ) => void
11476 ): void;
11477 (
11478 path: PathLikeTypes,
11479 options: ObjectEncodingOptions & {
11480 withFileTypes: true;
11481 recursive?: boolean;
11482 },
11483 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
11484 ): void;
11485}
11486declare interface ReadlinkFs {
11487 (
11488 path: PathLikeFs,
11489 options: EncodingOption,
11490 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11491 ): void;
11492 (
11493 path: PathLikeFs,
11494 options: BufferEncodingOption,
11495 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11496 ): void;
11497 (
11498 path: PathLikeFs,
11499 options: EncodingOption,
11500 callback: (
11501 arg0: null | NodeJS.ErrnoException,
11502 arg1?: string | Buffer
11503 ) => void
11504 ): void;
11505 (
11506 path: PathLikeFs,
11507 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11508 ): void;
11509}
11510declare interface ReadlinkSync {
11511 (path: PathLikeFs, options?: EncodingOption): string;
11512 (path: PathLikeFs, options: BufferEncodingOption): Buffer;
11513 (path: PathLikeFs, options?: EncodingOption): string | Buffer;
11514}
11515declare interface ReadlinkTypes {
11516 (
11517 path: PathLikeTypes,
11518 options: EncodingOption,
11519 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11520 ): void;
11521 (
11522 path: PathLikeTypes,
11523 options: BufferEncodingOption,
11524 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11525 ): void;
11526 (
11527 path: PathLikeTypes,
11528 options: EncodingOption,
11529 callback: (
11530 arg0: null | NodeJS.ErrnoException,
11531 arg1?: string | Buffer
11532 ) => void
11533 ): void;
11534 (
11535 path: PathLikeTypes,
11536 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11537 ): void;
11538}
11539declare class RealContentHashPlugin {
11540 constructor(__0: {
11541 /**
11542 * the hash function to use
11543 */
11544 hashFunction: string | typeof Hash;
11545 /**
11546 * the hash digest to use
11547 */
11548 hashDigest: string;
11549 });
11550
11551 /**
11552 * Apply the plugin
11553 */
11554 apply(compiler: Compiler): void;
11555 static getCompilationHooks(
11556 compilation: Compilation
11557 ): CompilationHooksRealContentHashPlugin;
11558}
11559declare interface RealDependencyLocation {
11560 start: SourcePosition;
11561 end?: SourcePosition;
11562 index?: number;
11563}
11564declare interface RealPathFs {
11565 (
11566 path: PathLikeFs,
11567 options: EncodingOption,
11568 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11569 ): void;
11570 (
11571 path: PathLikeFs,
11572 options: BufferEncodingOption,
11573 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11574 ): void;
11575 (
11576 path: PathLikeFs,
11577 options: EncodingOption,
11578 callback: (
11579 arg0: null | NodeJS.ErrnoException,
11580 arg1?: string | Buffer
11581 ) => void
11582 ): void;
11583 (
11584 path: PathLikeFs,
11585 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11586 ): void;
11587}
11588declare interface RealPathSync {
11589 (path: PathLikeFs, options?: EncodingOption): string;
11590 (path: PathLikeFs, options: BufferEncodingOption): Buffer;
11591 (path: PathLikeFs, options?: EncodingOption): string | Buffer;
11592}
11593declare interface RealPathTypes {
11594 (
11595 path: PathLikeTypes,
11596 options: EncodingOption,
11597 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11598 ): void;
11599 (
11600 path: PathLikeTypes,
11601 options: BufferEncodingOption,
11602 callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
11603 ): void;
11604 (
11605 path: PathLikeTypes,
11606 options: EncodingOption,
11607 callback: (
11608 arg0: null | NodeJS.ErrnoException,
11609 arg1?: string | Buffer
11610 ) => void
11611 ): void;
11612 (
11613 path: PathLikeTypes,
11614 callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
11615 ): void;
11616}
11617type RecursiveArrayOrRecord<T> =
11618 | { [index: string]: RecursiveArrayOrRecord<T> }
11619 | RecursiveArrayOrRecord<T>[]
11620 | T;
11621declare interface ReferencedExport {
11622 /**
11623 * name of the referenced export
11624 */
11625 name: string[];
11626
11627 /**
11628 * when false, referenced export can not be mangled, defaults to true
11629 */
11630 canMangle?: boolean;
11631}
11632type Remotes = (string | RemotesObject)[] | RemotesObject;
11633
11634/**
11635 * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
11636 */
11637declare interface RemotesConfig {
11638 /**
11639 * Container locations from which modules should be resolved and loaded at runtime.
11640 */
11641 external: string | string[];
11642
11643 /**
11644 * The name of the share scope shared with this remote.
11645 */
11646 shareScope?: string;
11647}
11648
11649/**
11650 * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
11651 */
11652declare interface RemotesObject {
11653 [index: string]: string | RemotesConfig | string[];
11654}
11655declare interface RenderBootstrapContext {
11656 /**
11657 * the chunk
11658 */
11659 chunk: Chunk;
11660
11661 /**
11662 * results of code generation
11663 */
11664 codeGenerationResults: CodeGenerationResults;
11665
11666 /**
11667 * the runtime template
11668 */
11669 runtimeTemplate: RuntimeTemplate;
11670
11671 /**
11672 * the module graph
11673 */
11674 moduleGraph: ModuleGraph;
11675
11676 /**
11677 * the chunk graph
11678 */
11679 chunkGraph: ChunkGraph;
11680
11681 /**
11682 * hash to be used for render call
11683 */
11684 hash: string;
11685}
11686declare interface RenderContext {
11687 /**
11688 * the chunk
11689 */
11690 chunk: Chunk;
11691
11692 /**
11693 * the dependency templates
11694 */
11695 dependencyTemplates: DependencyTemplates;
11696
11697 /**
11698 * the runtime template
11699 */
11700 runtimeTemplate: RuntimeTemplate;
11701
11702 /**
11703 * the module graph
11704 */
11705 moduleGraph: ModuleGraph;
11706
11707 /**
11708 * the chunk graph
11709 */
11710 chunkGraph: ChunkGraph;
11711
11712 /**
11713 * results of code generation
11714 */
11715 codeGenerationResults: CodeGenerationResults;
11716
11717 /**
11718 * rendering in strict context
11719 */
11720 strictMode?: boolean;
11721}
11722type RenderManifestEntry =
11723 | RenderManifestEntryTemplated
11724 | RenderManifestEntryStatic;
11725declare interface RenderManifestEntryStatic {
11726 render: () => Source;
11727 filename: string;
11728 info: AssetInfo;
11729 identifier: string;
11730 hash?: string;
11731 auxiliary?: boolean;
11732}
11733declare interface RenderManifestEntryTemplated {
11734 render: () => Source;
11735 filenameTemplate: TemplatePath;
11736 pathOptions?: PathData;
11737 info?: AssetInfo;
11738 identifier: string;
11739 hash?: string;
11740 auxiliary?: boolean;
11741}
11742declare interface RenderManifestOptions {
11743 /**
11744 * the chunk used to render
11745 */
11746 chunk: Chunk;
11747 hash: string;
11748 fullHash: string;
11749 outputOptions: Output;
11750 codeGenerationResults: CodeGenerationResults;
11751 moduleTemplates: { javascript: ModuleTemplate };
11752 dependencyTemplates: DependencyTemplates;
11753 runtimeTemplate: RuntimeTemplate;
11754 moduleGraph: ModuleGraph;
11755 chunkGraph: ChunkGraph;
11756}
11757declare class ReplaceSource extends Source {
11758 constructor(source: Source, name?: string);
11759 replace(start: number, end: number, newValue: string, name?: string): void;
11760 insert(pos: number, newValue: string, name?: string): void;
11761 getName(): string;
11762 original(): string;
11763 getReplacements(): {
11764 start: number;
11765 end: number;
11766 content: string;
11767 insertIndex: number;
11768 name: string;
11769 }[];
11770}
11771declare interface RequestRecord {
11772 [index: string]: string | string[];
11773}
11774declare abstract class RequestShortener {
11775 contextify: (arg0: string) => string;
11776 shorten(request?: null | string): undefined | null | string;
11777}
11778declare interface ResolveBuildDependenciesResult {
11779 /**
11780 * list of files
11781 */
11782 files: Set<string>;
11783
11784 /**
11785 * list of directories
11786 */
11787 directories: Set<string>;
11788
11789 /**
11790 * list of missing entries
11791 */
11792 missing: Set<string>;
11793
11794 /**
11795 * stored resolve results
11796 */
11797 resolveResults: Map<string, undefined | string | false>;
11798
11799 /**
11800 * dependencies of the resolving
11801 */
11802 resolveDependencies: {
11803 /**
11804 * list of files
11805 */
11806 files: Set<string>;
11807 /**
11808 * list of directories
11809 */
11810 directories: Set<string>;
11811 /**
11812 * list of missing entries
11813 */
11814 missing: Set<string>;
11815 };
11816}
11817declare interface ResolveContext {
11818 contextDependencies?: WriteOnlySet<string>;
11819
11820 /**
11821 * files that was found on file system
11822 */
11823 fileDependencies?: WriteOnlySet<string>;
11824
11825 /**
11826 * dependencies that was not found on file system
11827 */
11828 missingDependencies?: WriteOnlySet<string>;
11829
11830 /**
11831 * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
11832 */
11833 stack?: Set<string>;
11834
11835 /**
11836 * log function
11837 */
11838 log?: (arg0: string) => void;
11839
11840 /**
11841 * yield result, if provided plugins can return several results
11842 */
11843 yield?: (arg0: ResolveRequest) => void;
11844}
11845declare interface ResolveData {
11846 contextInfo: ModuleFactoryCreateDataContextInfo;
11847 resolveOptions?: ResolveOptions;
11848 context: string;
11849 request: string;
11850 assertions?: Record<string, any>;
11851 dependencies: ModuleDependency[];
11852 dependencyType: string;
11853 createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
11854 fileDependencies: LazySet<string>;
11855 missingDependencies: LazySet<string>;
11856 contextDependencies: LazySet<string>;
11857
11858 /**
11859 * allow to use the unsafe cache
11860 */
11861 cacheable: boolean;
11862}
11863
11864/**
11865 * Options object for resolving requests.
11866 */
11867declare interface ResolveOptions {
11868 /**
11869 * Redirect module requests.
11870 */
11871 alias?:
11872 | {
11873 /**
11874 * New request.
11875 */
11876 alias: string | false | string[];
11877 /**
11878 * Request to be redirected.
11879 */
11880 name: string;
11881 /**
11882 * Redirect only exact matching request.
11883 */
11884 onlyModule?: boolean;
11885 }[]
11886 | { [index: string]: string | false | string[] };
11887
11888 /**
11889 * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
11890 */
11891 aliasFields?: (string | string[])[];
11892
11893 /**
11894 * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
11895 */
11896 byDependency?: { [index: string]: ResolveOptions };
11897
11898 /**
11899 * Enable caching of successfully resolved requests (cache entries are revalidated).
11900 */
11901 cache?: boolean;
11902
11903 /**
11904 * Predicate function to decide which requests should be cached.
11905 */
11906 cachePredicate?: (request: ResolveRequest) => boolean;
11907
11908 /**
11909 * Include the context information in the cache identifier when caching.
11910 */
11911 cacheWithContext?: boolean;
11912
11913 /**
11914 * Condition names for exports field entry point.
11915 */
11916 conditionNames?: string[];
11917
11918 /**
11919 * Filenames used to find a description file (like a package.json).
11920 */
11921 descriptionFiles?: string[];
11922
11923 /**
11924 * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
11925 */
11926 enforceExtension?: boolean;
11927
11928 /**
11929 * Field names from the description file (usually package.json) which are used to provide entry points of a package.
11930 */
11931 exportsFields?: string[];
11932
11933 /**
11934 * An object which maps extension to extension aliases.
11935 */
11936 extensionAlias?: { [index: string]: string | string[] };
11937
11938 /**
11939 * Extensions added to the request when trying to find the file.
11940 */
11941 extensions?: string[];
11942
11943 /**
11944 * Redirect module requests when normal resolving fails.
11945 */
11946 fallback?:
11947 | {
11948 /**
11949 * New request.
11950 */
11951 alias: string | false | string[];
11952 /**
11953 * Request to be redirected.
11954 */
11955 name: string;
11956 /**
11957 * Redirect only exact matching request.
11958 */
11959 onlyModule?: boolean;
11960 }[]
11961 | { [index: string]: string | false | string[] };
11962
11963 /**
11964 * Filesystem for the resolver.
11965 */
11966 fileSystem?: InputFileSystem;
11967
11968 /**
11969 * Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
11970 */
11971 fullySpecified?: boolean;
11972
11973 /**
11974 * Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
11975 */
11976 importsFields?: string[];
11977
11978 /**
11979 * Field names from the description file (package.json) which are used to find the default entry point.
11980 */
11981 mainFields?: (string | string[])[];
11982
11983 /**
11984 * Filenames used to find the default entry point if there is no description file or main field.
11985 */
11986 mainFiles?: string[];
11987
11988 /**
11989 * Folder names or directory paths where to find modules.
11990 */
11991 modules?: string[];
11992
11993 /**
11994 * Plugins for the resolver.
11995 */
11996 plugins?: (
11997 | undefined
11998 | null
11999 | false
12000 | ""
12001 | 0
12002 | {
12003 [index: string]: any;
12004 /**
12005 * The run point of the plugin, required method.
12006 */
12007 apply: (arg0: Resolver) => void;
12008 }
12009 | ((this: Resolver, arg1: Resolver) => void)
12010 | "..."
12011 )[];
12012
12013 /**
12014 * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
12015 */
12016 preferAbsolute?: boolean;
12017
12018 /**
12019 * Prefer to resolve module requests as relative request and fallback to resolving as module.
12020 */
12021 preferRelative?: boolean;
12022
12023 /**
12024 * Custom resolver.
12025 */
12026 resolver?: Resolver;
12027
12028 /**
12029 * A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.
12030 */
12031 restrictions?: (string | RegExp)[];
12032
12033 /**
12034 * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
12035 */
12036 roots?: string[];
12037
12038 /**
12039 * Enable resolving symlinks to the original location.
12040 */
12041 symlinks?: boolean;
12042
12043 /**
12044 * Enable caching of successfully resolved requests (cache entries are not revalidated).
12045 */
12046 unsafeCache?: boolean | { [index: string]: any };
12047
12048 /**
12049 * Use synchronous filesystem calls for the resolver.
12050 */
12051 useSyncFileSystemCalls?: boolean;
12052}
12053declare interface ResolveOptionsResolverFactoryObject1 {
12054 alias: AliasOption[];
12055 fallback: AliasOption[];
12056 aliasFields: Set<string | string[]>;
12057 extensionAlias: ExtensionAliasOption[];
12058 cachePredicate: (arg0: ResolveRequest) => boolean;
12059 cacheWithContext: boolean;
12060
12061 /**
12062 * A list of exports field condition names.
12063 */
12064 conditionNames: Set<string>;
12065 descriptionFiles: string[];
12066 enforceExtension: boolean;
12067 exportsFields: Set<string | string[]>;
12068 importsFields: Set<string | string[]>;
12069 extensions: Set<string>;
12070 fileSystem: FileSystem;
12071 unsafeCache: false | object;
12072 symlinks: boolean;
12073 resolver?: Resolver;
12074 modules: (string | string[])[];
12075 mainFields: { name: string[]; forceRelative: boolean }[];
12076 mainFiles: Set<string>;
12077 plugins: Plugin[];
12078 pnpApi: null | PnpApi;
12079 roots: Set<string>;
12080 fullySpecified: boolean;
12081 resolveToContext: boolean;
12082 restrictions: Set<string | RegExp>;
12083 preferRelative: boolean;
12084 preferAbsolute: boolean;
12085}
12086declare interface ResolveOptionsResolverFactoryObject2 {
12087 /**
12088 * A list of module alias configurations or an object which maps key to value
12089 */
12090 alias?: AliasOption[] | AliasOptions;
12091
12092 /**
12093 * A list of module alias configurations or an object which maps key to value, applied only after modules option
12094 */
12095 fallback?: AliasOption[] | AliasOptions;
12096
12097 /**
12098 * An object which maps extension to extension aliases
12099 */
12100 extensionAlias?: ExtensionAliasOptions;
12101
12102 /**
12103 * A list of alias fields in description files
12104 */
12105 aliasFields?: (string | string[])[];
12106
12107 /**
12108 * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
12109 */
12110 cachePredicate?: (arg0: ResolveRequest) => boolean;
12111
12112 /**
12113 * Whether or not the unsafeCache should include request context as part of the cache key.
12114 */
12115 cacheWithContext?: boolean;
12116
12117 /**
12118 * A list of description files to read from
12119 */
12120 descriptionFiles?: string[];
12121
12122 /**
12123 * A list of exports field condition names.
12124 */
12125 conditionNames?: string[];
12126
12127 /**
12128 * Enforce that a extension from extensions must be used
12129 */
12130 enforceExtension?: boolean;
12131
12132 /**
12133 * A list of exports fields in description files
12134 */
12135 exportsFields?: (string | string[])[];
12136
12137 /**
12138 * A list of imports fields in description files
12139 */
12140 importsFields?: (string | string[])[];
12141
12142 /**
12143 * A list of extensions which should be tried for files
12144 */
12145 extensions?: string[];
12146
12147 /**
12148 * The file system which should be used
12149 */
12150 fileSystem: FileSystem;
12151
12152 /**
12153 * Use this cache object to unsafely cache the successful requests
12154 */
12155 unsafeCache?: boolean | object;
12156
12157 /**
12158 * Resolve symlinks to their symlinked location
12159 */
12160 symlinks?: boolean;
12161
12162 /**
12163 * A prepared Resolver to which the plugins are attached
12164 */
12165 resolver?: Resolver;
12166
12167 /**
12168 * A list of directories to resolve modules from, can be absolute path or folder name
12169 */
12170 modules?: string | string[];
12171
12172 /**
12173 * A list of main fields in description files
12174 */
12175 mainFields?: (
12176 | string
12177 | string[]
12178 | { name: string | string[]; forceRelative: boolean }
12179 )[];
12180
12181 /**
12182 * A list of main files in directories
12183 */
12184 mainFiles?: string[];
12185
12186 /**
12187 * A list of additional resolve plugins which should be applied
12188 */
12189 plugins?: Plugin[];
12190
12191 /**
12192 * A PnP API that should be used - null is "never", undefined is "auto"
12193 */
12194 pnpApi?: null | PnpApi;
12195
12196 /**
12197 * A list of root paths
12198 */
12199 roots?: string[];
12200
12201 /**
12202 * The request is already fully specified and no extensions or directories are resolved for it
12203 */
12204 fullySpecified?: boolean;
12205
12206 /**
12207 * Resolve to a context instead of a file
12208 */
12209 resolveToContext?: boolean;
12210
12211 /**
12212 * A list of resolve restrictions
12213 */
12214 restrictions?: (string | RegExp)[];
12215
12216 /**
12217 * Use only the sync constraints of the file system calls
12218 */
12219 useSyncFileSystemCalls?: boolean;
12220
12221 /**
12222 * Prefer to resolve module requests as relative requests before falling back to modules
12223 */
12224 preferRelative?: boolean;
12225
12226 /**
12227 * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
12228 */
12229 preferAbsolute?: boolean;
12230}
12231type ResolveOptionsWithDependencyType = ResolveOptions & {
12232 dependencyType?: string;
12233 resolveToContext?: boolean;
12234};
12235type ResolvePluginInstance =
12236 | {
12237 [index: string]: any;
12238 /**
12239 * The run point of the plugin, required method.
12240 */
12241 apply: (arg0: Resolver) => void;
12242 }
12243 | ((this: Resolver, arg1: Resolver) => void);
12244type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
12245declare interface ResolvedContextFileSystemInfoEntry {
12246 safeTime: number;
12247 timestampHash?: string;
12248}
12249declare interface ResolvedContextTimestampAndHash {
12250 safeTime: number;
12251 timestampHash?: string;
12252 hash: string;
12253}
12254declare interface ResolvedOptions {
12255 /**
12256 * - platform target properties
12257 */
12258 platform: false | PlatformTargetProperties;
12259}
12260declare abstract class Resolver {
12261 fileSystem: FileSystem;
12262 options: ResolveOptionsResolverFactoryObject1;
12263 hooks: KnownHooks;
12264 ensureHook(
12265 name:
12266 | string
12267 | AsyncSeriesBailHook<
12268 [ResolveRequest, ResolveContext],
12269 null | ResolveRequest
12270 >
12271 ): AsyncSeriesBailHook<
12272 [ResolveRequest, ResolveContext],
12273 null | ResolveRequest
12274 >;
12275 getHook(
12276 name:
12277 | string
12278 | AsyncSeriesBailHook<
12279 [ResolveRequest, ResolveContext],
12280 null | ResolveRequest
12281 >
12282 ): AsyncSeriesBailHook<
12283 [ResolveRequest, ResolveContext],
12284 null | ResolveRequest
12285 >;
12286 resolveSync(context: object, path: string, request: string): string | false;
12287 resolve(
12288 context: object,
12289 path: string,
12290 request: string,
12291 resolveContext: ResolveContext,
12292 callback: (
12293 err: null | ErrorWithDetail,
12294 res?: string | false,
12295 req?: ResolveRequest
12296 ) => void
12297 ): void;
12298 doResolve(
12299 hook: AsyncSeriesBailHook<
12300 [ResolveRequest, ResolveContext],
12301 null | ResolveRequest
12302 >,
12303 request: ResolveRequest,
12304 message: null | string,
12305 resolveContext: ResolveContext,
12306 callback: (err?: null | Error, result?: ResolveRequest) => void
12307 ): void;
12308 parse(identifier: string): ParsedIdentifier;
12309 isModule(path: string): boolean;
12310 isPrivate(path: string): boolean;
12311 isDirectory(path: string): boolean;
12312 join(path: string, request: string): string;
12313 normalize(path: string): string;
12314}
12315declare interface ResolverCache {
12316 direct: WeakMap<object, ResolverWithOptions>;
12317 stringified: Map<string, ResolverWithOptions>;
12318}
12319declare abstract class ResolverFactory {
12320 hooks: Readonly<{
12321 resolveOptions: HookMap<
12322 SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
12323 >;
12324 resolver: HookMap<
12325 SyncHook<
12326 [
12327 Resolver,
12328 ResolveOptionsResolverFactoryObject2,
12329 ResolveOptionsWithDependencyType
12330 ]
12331 >
12332 >;
12333 }>;
12334 cache: Map<string, ResolverCache>;
12335 get(
12336 type: string,
12337 resolveOptions?: ResolveOptionsWithDependencyType
12338 ): ResolverWithOptions;
12339}
12340type ResolverWithOptions = Resolver & WithOptions;
12341
12342declare interface ResourceDataWithData {
12343 resource: string;
12344 path?: string;
12345 query?: string;
12346 fragment?: string;
12347 context?: string;
12348 data: Record<string, any>;
12349}
12350declare abstract class RestoreProvidedData {
12351 exports: any;
12352 otherProvided: any;
12353 otherCanMangleProvide: any;
12354 otherTerminalBinding: any;
12355 serialize(__0: ObjectSerializerContext): void;
12356}
12357declare interface RmDirOptions {
12358 maxRetries?: number;
12359 recursive?: boolean;
12360 retryDelay?: number;
12361}
12362declare interface Rmdir {
12363 (
12364 file: PathLikeFs,
12365 callback: (arg0: null | NodeJS.ErrnoException) => void
12366 ): void;
12367 (
12368 file: PathLikeFs,
12369 options: RmDirOptions,
12370 callback: (arg0: null | NodeJS.ErrnoException) => void
12371 ): void;
12372}
12373type Rule = string | RegExp;
12374declare interface RuleSet {
12375 /**
12376 * map of references in the rule set (may grow over time)
12377 */
12378 references: Map<string, any>;
12379
12380 /**
12381 * execute the rule set
12382 */
12383 exec: (arg0: EffectData) => Effect[];
12384}
12385type RuleSetCondition =
12386 | string
12387 | RegExp
12388 | ((value: string) => boolean)
12389 | RuleSetLogicalConditions
12390 | RuleSetCondition[];
12391type RuleSetConditionAbsolute =
12392 | string
12393 | RegExp
12394 | ((value: string) => boolean)
12395 | RuleSetLogicalConditionsAbsolute
12396 | RuleSetConditionAbsolute[];
12397type RuleSetConditionOrConditions =
12398 | string
12399 | RegExp
12400 | ((value: string) => boolean)
12401 | RuleSetLogicalConditions
12402 | RuleSetCondition[];
12403
12404/**
12405 * Logic operators used in a condition matcher.
12406 */
12407declare interface RuleSetLogicalConditions {
12408 /**
12409 * Logical AND.
12410 */
12411 and?: RuleSetCondition[];
12412
12413 /**
12414 * Logical NOT.
12415 */
12416 not?:
12417 | string
12418 | RegExp
12419 | ((value: string) => boolean)
12420 | RuleSetLogicalConditions
12421 | RuleSetCondition[];
12422
12423 /**
12424 * Logical OR.
12425 */
12426 or?: RuleSetCondition[];
12427}
12428
12429/**
12430 * Logic operators used in a condition matcher.
12431 */
12432declare interface RuleSetLogicalConditionsAbsolute {
12433 /**
12434 * Logical AND.
12435 */
12436 and?: RuleSetConditionAbsolute[];
12437
12438 /**
12439 * Logical NOT.
12440 */
12441 not?:
12442 | string
12443 | RegExp
12444 | ((value: string) => boolean)
12445 | RuleSetLogicalConditionsAbsolute
12446 | RuleSetConditionAbsolute[];
12447
12448 /**
12449 * Logical OR.
12450 */
12451 or?: RuleSetConditionAbsolute[];
12452}
12453
12454/**
12455 * A rule description with conditions and effects for modules.
12456 */
12457declare interface RuleSetRule {
12458 /**
12459 * Match on import assertions of the dependency.
12460 */
12461 assert?: { [index: string]: RuleSetConditionOrConditions };
12462
12463 /**
12464 * Match the child compiler name.
12465 */
12466 compiler?:
12467 | string
12468 | RegExp
12469 | ((value: string) => boolean)
12470 | RuleSetLogicalConditions
12471 | RuleSetCondition[];
12472
12473 /**
12474 * Match dependency type.
12475 */
12476 dependency?:
12477 | string
12478 | RegExp
12479 | ((value: string) => boolean)
12480 | RuleSetLogicalConditions
12481 | RuleSetCondition[];
12482
12483 /**
12484 * Match values of properties in the description file (usually package.json).
12485 */
12486 descriptionData?: { [index: string]: RuleSetConditionOrConditions };
12487
12488 /**
12489 * Enforce this rule as pre or post step.
12490 */
12491 enforce?: "pre" | "post";
12492
12493 /**
12494 * Shortcut for resource.exclude.
12495 */
12496 exclude?:
12497 | string
12498 | RegExp
12499 | ((value: string) => boolean)
12500 | RuleSetLogicalConditionsAbsolute
12501 | RuleSetConditionAbsolute[];
12502
12503 /**
12504 * The options for the module generator.
12505 */
12506 generator?: { [index: string]: any };
12507
12508 /**
12509 * Shortcut for resource.include.
12510 */
12511 include?:
12512 | string
12513 | RegExp
12514 | ((value: string) => boolean)
12515 | RuleSetLogicalConditionsAbsolute
12516 | RuleSetConditionAbsolute[];
12517
12518 /**
12519 * Match the issuer of the module (The module pointing to this module).
12520 */
12521 issuer?:
12522 | string
12523 | RegExp
12524 | ((value: string) => boolean)
12525 | RuleSetLogicalConditionsAbsolute
12526 | RuleSetConditionAbsolute[];
12527
12528 /**
12529 * Match layer of the issuer of this module (The module pointing to this module).
12530 */
12531 issuerLayer?:
12532 | string
12533 | RegExp
12534 | ((value: string) => boolean)
12535 | RuleSetLogicalConditions
12536 | RuleSetCondition[];
12537
12538 /**
12539 * Specifies the layer in which the module should be placed in.
12540 */
12541 layer?: string;
12542
12543 /**
12544 * Shortcut for use.loader.
12545 */
12546 loader?: string;
12547
12548 /**
12549 * Match module mimetype when load from Data URI.
12550 */
12551 mimetype?:
12552 | string
12553 | RegExp
12554 | ((value: string) => boolean)
12555 | RuleSetLogicalConditions
12556 | RuleSetCondition[];
12557
12558 /**
12559 * Only execute the first matching rule in this array.
12560 */
12561 oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
12562
12563 /**
12564 * Shortcut for use.options.
12565 */
12566 options?: string | { [index: string]: any };
12567
12568 /**
12569 * Options for parsing.
12570 */
12571 parser?: { [index: string]: any };
12572
12573 /**
12574 * Match the real resource path of the module.
12575 */
12576 realResource?:
12577 | string
12578 | RegExp
12579 | ((value: string) => boolean)
12580 | RuleSetLogicalConditionsAbsolute
12581 | RuleSetConditionAbsolute[];
12582
12583 /**
12584 * Options for the resolver.
12585 */
12586 resolve?: ResolveOptions;
12587
12588 /**
12589 * Match the resource path of the module.
12590 */
12591 resource?:
12592 | string
12593 | RegExp
12594 | ((value: string) => boolean)
12595 | RuleSetLogicalConditionsAbsolute
12596 | RuleSetConditionAbsolute[];
12597
12598 /**
12599 * Match the resource fragment of the module.
12600 */
12601 resourceFragment?:
12602 | string
12603 | RegExp
12604 | ((value: string) => boolean)
12605 | RuleSetLogicalConditions
12606 | RuleSetCondition[];
12607
12608 /**
12609 * Match the resource query of the module.
12610 */
12611 resourceQuery?:
12612 | string
12613 | RegExp
12614 | ((value: string) => boolean)
12615 | RuleSetLogicalConditions
12616 | RuleSetCondition[];
12617
12618 /**
12619 * Match and execute these rules when this rule is matched.
12620 */
12621 rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
12622
12623 /**
12624 * Match module scheme.
12625 */
12626 scheme?:
12627 | string
12628 | RegExp
12629 | ((value: string) => boolean)
12630 | RuleSetLogicalConditions
12631 | RuleSetCondition[];
12632
12633 /**
12634 * Flags a module as with or without side effects.
12635 */
12636 sideEffects?: boolean;
12637
12638 /**
12639 * Shortcut for resource.test.
12640 */
12641 test?:
12642 | string
12643 | RegExp
12644 | ((value: string) => boolean)
12645 | RuleSetLogicalConditionsAbsolute
12646 | RuleSetConditionAbsolute[];
12647
12648 /**
12649 * Module type to use for the module.
12650 */
12651 type?: string;
12652
12653 /**
12654 * Modifiers applied to the module when rule is matched.
12655 */
12656 use?:
12657 | string
12658 | (
12659 | undefined
12660 | null
12661 | string
12662 | false
12663 | 0
12664 | {
12665 /**
12666 * Unique loader options identifier.
12667 */
12668 ident?: string;
12669 /**
12670 * Loader name.
12671 */
12672 loader?: string;
12673 /**
12674 * Loader options.
12675 */
12676 options?: string | { [index: string]: any };
12677 }
12678 | ((data: object) =>
12679 | string
12680 | {
12681 /**
12682 * Unique loader options identifier.
12683 */
12684 ident?: string;
12685 /**
12686 * Loader name.
12687 */
12688 loader?: string;
12689 /**
12690 * Loader options.
12691 */
12692 options?: string | { [index: string]: any };
12693 }
12694 | __TypeWebpackOptions
12695 | __Type_2[])
12696 )[]
12697 | ((data: {
12698 resource: string;
12699 realResource: string;
12700 resourceQuery: string;
12701 issuer: string;
12702 compiler: string;
12703 }) => __Type_2[])
12704 | {
12705 /**
12706 * Unique loader options identifier.
12707 */
12708 ident?: string;
12709 /**
12710 * Loader name.
12711 */
12712 loader?: string;
12713 /**
12714 * Loader options.
12715 */
12716 options?: string | { [index: string]: any };
12717 }
12718 | __TypeWebpackOptions;
12719
12720 /**
12721 * Match on import attributes of the dependency.
12722 */
12723 with?: { [index: string]: RuleSetConditionOrConditions };
12724}
12725type RuleSetUse =
12726 | string
12727 | (
12728 | undefined
12729 | null
12730 | string
12731 | false
12732 | 0
12733 | {
12734 /**
12735 * Unique loader options identifier.
12736 */
12737 ident?: string;
12738 /**
12739 * Loader name.
12740 */
12741 loader?: string;
12742 /**
12743 * Loader options.
12744 */
12745 options?: string | { [index: string]: any };
12746 }
12747 | ((data: object) =>
12748 | string
12749 | {
12750 /**
12751 * Unique loader options identifier.
12752 */
12753 ident?: string;
12754 /**
12755 * Loader name.
12756 */
12757 loader?: string;
12758 /**
12759 * Loader options.
12760 */
12761 options?: string | { [index: string]: any };
12762 }
12763 | __TypeWebpackOptions
12764 | __Type_2[])
12765 )[]
12766 | ((data: {
12767 resource: string;
12768 realResource: string;
12769 resourceQuery: string;
12770 issuer: string;
12771 compiler: string;
12772 }) => __Type_2[])
12773 | {
12774 /**
12775 * Unique loader options identifier.
12776 */
12777 ident?: string;
12778 /**
12779 * Loader name.
12780 */
12781 loader?: string;
12782 /**
12783 * Loader options.
12784 */
12785 options?: string | { [index: string]: any };
12786 }
12787 | __TypeWebpackOptions;
12788type RuleSetUseItem =
12789 | string
12790 | {
12791 /**
12792 * Unique loader options identifier.
12793 */
12794 ident?: string;
12795 /**
12796 * Loader name.
12797 */
12798 loader?: string;
12799 /**
12800 * Loader options.
12801 */
12802 options?: string | { [index: string]: any };
12803 }
12804 | __TypeWebpackOptions;
12805declare interface RunCallback<T> {
12806 (err: null | Error, result?: T): any;
12807}
12808declare class RuntimeChunkPlugin {
12809 constructor(options: { name?: (entrypoint: { name: string }) => string });
12810 options: {
12811 name:
12812 | ((entrypoint: { name: string }) => string)
12813 | ((entrypoint: Entrypoint) => string);
12814 };
12815
12816 /**
12817 * Apply the plugin
12818 */
12819 apply(compiler: Compiler): void;
12820}
12821type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
12822declare class RuntimeModule extends Module {
12823 constructor(name: string, stage?: number);
12824 name: string;
12825 stage: number;
12826 compilation?: Compilation;
12827 chunk?: Chunk;
12828 chunkGraph?: ChunkGraph;
12829 fullHash: boolean;
12830 dependentHash: boolean;
12831 attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
12832 generate(): null | string;
12833 getGeneratedCode(): null | string;
12834 shouldIsolate(): boolean;
12835
12836 /**
12837 * Runtime modules without any dependencies to other runtime modules
12838 */
12839 static STAGE_NORMAL: number;
12840
12841 /**
12842 * Runtime modules with simple dependencies on other runtime modules
12843 */
12844 static STAGE_BASIC: number;
12845
12846 /**
12847 * Runtime modules which attach to handlers of other runtime modules
12848 */
12849 static STAGE_ATTACH: number;
12850
12851 /**
12852 * Runtime modules which trigger actions on bootstrap
12853 */
12854 static STAGE_TRIGGER: number;
12855}
12856declare interface RuntimeRequirementsContext {
12857 /**
12858 * the chunk graph
12859 */
12860 chunkGraph: ChunkGraph;
12861
12862 /**
12863 * the code generation results
12864 */
12865 codeGenerationResults: CodeGenerationResults;
12866}
12867type RuntimeSpec = undefined | string | SortableSet<string>;
12868declare class RuntimeSpecMap<T> {
12869 constructor(clone?: RuntimeSpecMap<T>);
12870 get(runtime: RuntimeSpec): undefined | T;
12871 has(runtime: RuntimeSpec): boolean;
12872 set(runtime: RuntimeSpec, value: T): void;
12873 provide(runtime: RuntimeSpec, computer: () => any): any;
12874 delete(runtime: RuntimeSpec): void;
12875 update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
12876 keys(): RuntimeSpec[];
12877 values(): IterableIterator<T>;
12878 get size(): number;
12879}
12880declare class RuntimeSpecSet {
12881 constructor(iterable?: Iterable<RuntimeSpec>);
12882 add(runtime: RuntimeSpec): void;
12883 has(runtime: RuntimeSpec): boolean;
12884 get size(): number;
12885 [Symbol.iterator](): IterableIterator<RuntimeSpec>;
12886}
12887declare abstract class RuntimeTemplate {
12888 compilation: Compilation;
12889 outputOptions: OutputNormalized;
12890 requestShortener: RequestShortener;
12891 globalObject: string;
12892 contentHashReplacement: string;
12893 isIIFE(): undefined | boolean;
12894 isModule(): undefined | boolean;
12895 supportsConst(): undefined | boolean;
12896 supportsArrowFunction(): undefined | boolean;
12897 supportsAsyncFunction(): undefined | boolean;
12898 supportsOptionalChaining(): undefined | boolean;
12899 supportsForOf(): undefined | boolean;
12900 supportsDestructuring(): undefined | boolean;
12901 supportsBigIntLiteral(): undefined | boolean;
12902 supportsDynamicImport(): undefined | boolean;
12903 supportsEcmaScriptModuleSyntax(): undefined | boolean;
12904 supportTemplateLiteral(): undefined | boolean;
12905 supportNodePrefixForCoreModules(): undefined | boolean;
12906 returningFunction(returnValue: string, args?: string): string;
12907 basicFunction(args: string, body: string | string[]): string;
12908 concatenation(...args: (string | { expr: string })[]): string;
12909 expressionFunction(expression: string, args?: string): string;
12910 emptyFunction(): string;
12911 destructureArray(items: string[], value: string): string;
12912 destructureObject(items: string[], value: string): string;
12913 iife(args: string, body: string): string;
12914 forEach(variable: string, array: string, body: string | string[]): string;
12915
12916 /**
12917 * Add a comment
12918 */
12919 comment(__0: {
12920 /**
12921 * request string used originally
12922 */
12923 request?: string;
12924 /**
12925 * name of the chunk referenced
12926 */
12927 chunkName?: string;
12928 /**
12929 * reason information of the chunk
12930 */
12931 chunkReason?: string;
12932 /**
12933 * additional message
12934 */
12935 message?: string;
12936 /**
12937 * name of the export
12938 */
12939 exportName?: string;
12940 }): string;
12941 throwMissingModuleErrorBlock(__0: {
12942 /**
12943 * request string used originally
12944 */
12945 request?: string;
12946 }): string;
12947 throwMissingModuleErrorFunction(__0: {
12948 /**
12949 * request string used originally
12950 */
12951 request?: string;
12952 }): string;
12953 missingModule(__0: {
12954 /**
12955 * request string used originally
12956 */
12957 request?: string;
12958 }): string;
12959 missingModuleStatement(__0: {
12960 /**
12961 * request string used originally
12962 */
12963 request?: string;
12964 }): string;
12965 missingModulePromise(__0: {
12966 /**
12967 * request string used originally
12968 */
12969 request?: string;
12970 }): string;
12971 weakError(__0: {
12972 /**
12973 * the chunk graph
12974 */
12975 chunkGraph: ChunkGraph;
12976 /**
12977 * the module
12978 */
12979 module: Module;
12980 /**
12981 * the request that should be printed as comment
12982 */
12983 request?: string;
12984 /**
12985 * expression to use as id expression
12986 */
12987 idExpr?: string;
12988 /**
12989 * which kind of code should be returned
12990 */
12991 type: "promise" | "expression" | "statements";
12992 }): string;
12993 moduleId(__0: {
12994 /**
12995 * the module
12996 */
12997 module: Module;
12998 /**
12999 * the chunk graph
13000 */
13001 chunkGraph: ChunkGraph;
13002 /**
13003 * the request that should be printed as comment
13004 */
13005 request?: string;
13006 /**
13007 * if the dependency is weak (will create a nice error message)
13008 */
13009 weak?: boolean;
13010 }): string;
13011 moduleRaw(__0: {
13012 /**
13013 * the module
13014 */
13015 module: null | Module;
13016 /**
13017 * the chunk graph
13018 */
13019 chunkGraph: ChunkGraph;
13020 /**
13021 * the request that should be printed as comment
13022 */
13023 request?: string;
13024 /**
13025 * if the dependency is weak (will create a nice error message)
13026 */
13027 weak?: boolean;
13028 /**
13029 * if set, will be filled with runtime requirements
13030 */
13031 runtimeRequirements: Set<string>;
13032 }): string;
13033 moduleExports(__0: {
13034 /**
13035 * the module
13036 */
13037 module: null | Module;
13038 /**
13039 * the chunk graph
13040 */
13041 chunkGraph: ChunkGraph;
13042 /**
13043 * the request that should be printed as comment
13044 */
13045 request: string;
13046 /**
13047 * if the dependency is weak (will create a nice error message)
13048 */
13049 weak?: boolean;
13050 /**
13051 * if set, will be filled with runtime requirements
13052 */
13053 runtimeRequirements: Set<string>;
13054 }): string;
13055 moduleNamespace(__0: {
13056 /**
13057 * the module
13058 */
13059 module: Module;
13060 /**
13061 * the chunk graph
13062 */
13063 chunkGraph: ChunkGraph;
13064 /**
13065 * the request that should be printed as comment
13066 */
13067 request: string;
13068 /**
13069 * if the current module is in strict esm mode
13070 */
13071 strict?: boolean;
13072 /**
13073 * if the dependency is weak (will create a nice error message)
13074 */
13075 weak?: boolean;
13076 /**
13077 * if set, will be filled with runtime requirements
13078 */
13079 runtimeRequirements: Set<string>;
13080 }): string;
13081 moduleNamespacePromise(__0: {
13082 /**
13083 * the chunk graph
13084 */
13085 chunkGraph: ChunkGraph;
13086 /**
13087 * the current dependencies block
13088 */
13089 block?: AsyncDependenciesBlock;
13090 /**
13091 * the module
13092 */
13093 module: Module;
13094 /**
13095 * the request that should be printed as comment
13096 */
13097 request: string;
13098 /**
13099 * a message for the comment
13100 */
13101 message: string;
13102 /**
13103 * if the current module is in strict esm mode
13104 */
13105 strict?: boolean;
13106 /**
13107 * if the dependency is weak (will create a nice error message)
13108 */
13109 weak?: boolean;
13110 /**
13111 * if set, will be filled with runtime requirements
13112 */
13113 runtimeRequirements: Set<string>;
13114 }): string;
13115 runtimeConditionExpression(__0: {
13116 /**
13117 * the chunk graph
13118 */
13119 chunkGraph: ChunkGraph;
13120 /**
13121 * runtime for which this code will be generated
13122 */
13123 runtime?: RuntimeSpec;
13124 /**
13125 * only execute the statement in some runtimes
13126 */
13127 runtimeCondition?: string | boolean | SortableSet<string>;
13128 /**
13129 * if set, will be filled with runtime requirements
13130 */
13131 runtimeRequirements: Set<string>;
13132 }): string;
13133 importStatement(__0: {
13134 /**
13135 * whether a new variable should be created or the existing one updated
13136 */
13137 update?: boolean;
13138 /**
13139 * the module
13140 */
13141 module: Module;
13142 /**
13143 * the chunk graph
13144 */
13145 chunkGraph: ChunkGraph;
13146 /**
13147 * the request that should be printed as comment
13148 */
13149 request: string;
13150 /**
13151 * name of the import variable
13152 */
13153 importVar: string;
13154 /**
13155 * module in which the statement is emitted
13156 */
13157 originModule: Module;
13158 /**
13159 * true, if this is a weak dependency
13160 */
13161 weak?: boolean;
13162 /**
13163 * if set, will be filled with runtime requirements
13164 */
13165 runtimeRequirements: Set<string>;
13166 }): [string, string];
13167 exportFromImport(__0: {
13168 /**
13169 * the module graph
13170 */
13171 moduleGraph: ModuleGraph;
13172 /**
13173 * the module
13174 */
13175 module: Module;
13176 /**
13177 * the request
13178 */
13179 request: string;
13180 /**
13181 * the export name
13182 */
13183 exportName: string | string[];
13184 /**
13185 * the origin module
13186 */
13187 originModule: Module;
13188 /**
13189 * true, if location is safe for ASI, a bracket can be emitted
13190 */
13191 asiSafe?: boolean;
13192 /**
13193 * true, if expression will be called
13194 */
13195 isCall: boolean;
13196 /**
13197 * when false, call context will not be preserved
13198 */
13199 callContext: null | boolean;
13200 /**
13201 * when true and accessing the default exports, interop code will be generated
13202 */
13203 defaultInterop: boolean;
13204 /**
13205 * the identifier name of the import variable
13206 */
13207 importVar: string;
13208 /**
13209 * init fragments will be added here
13210 */
13211 initFragments: InitFragment<any>[];
13212 /**
13213 * runtime for which this code will be generated
13214 */
13215 runtime: RuntimeSpec;
13216 /**
13217 * if set, will be filled with runtime requirements
13218 */
13219 runtimeRequirements: Set<string>;
13220 }): string;
13221 blockPromise(__0: {
13222 /**
13223 * the async block
13224 */
13225 block?: AsyncDependenciesBlock;
13226 /**
13227 * the message
13228 */
13229 message: string;
13230 /**
13231 * the chunk graph
13232 */
13233 chunkGraph: ChunkGraph;
13234 /**
13235 * if set, will be filled with runtime requirements
13236 */
13237 runtimeRequirements: Set<string>;
13238 }): string;
13239 asyncModuleFactory(__0: {
13240 /**
13241 * the async block
13242 */
13243 block: AsyncDependenciesBlock;
13244 /**
13245 * the chunk graph
13246 */
13247 chunkGraph: ChunkGraph;
13248 /**
13249 * if set, will be filled with runtime requirements
13250 */
13251 runtimeRequirements: Set<string>;
13252 /**
13253 * request string used originally
13254 */
13255 request?: string;
13256 }): string;
13257 syncModuleFactory(__0: {
13258 /**
13259 * the dependency
13260 */
13261 dependency: Dependency;
13262 /**
13263 * the chunk graph
13264 */
13265 chunkGraph: ChunkGraph;
13266 /**
13267 * if set, will be filled with runtime requirements
13268 */
13269 runtimeRequirements: Set<string>;
13270 /**
13271 * request string used originally
13272 */
13273 request?: string;
13274 }): string;
13275 defineEsModuleFlagStatement(__0: {
13276 /**
13277 * the name of the exports object
13278 */
13279 exportsArgument: string;
13280 /**
13281 * if set, will be filled with runtime requirements
13282 */
13283 runtimeRequirements: Set<string>;
13284 }): string;
13285 assetUrl(__0: {
13286 /**
13287 * the module
13288 */
13289 module: Module;
13290 /**
13291 * runtime
13292 */
13293 runtime?: RuntimeSpec;
13294 /**
13295 * the code generation results
13296 */
13297 codeGenerationResults: CodeGenerationResults;
13298 }): string;
13299}
13300declare abstract class RuntimeValue {
13301 fn: (arg0: {
13302 module: NormalModule;
13303 key: string;
13304 readonly version: ValueCacheVersion;
13305 }) => CodeValuePrimitive;
13306 options: true | RuntimeValueOptions;
13307 get fileDependencies(): true | string[];
13308 exec(
13309 parser: JavascriptParser,
13310 valueCacheVersions: Map<string, ValueCacheVersion>,
13311 key: string
13312 ): CodeValuePrimitive;
13313 getCacheVersion(): undefined | string;
13314}
13315declare interface RuntimeValueOptions {
13316 fileDependencies?: string[];
13317 contextDependencies?: string[];
13318 missingDependencies?: string[];
13319 buildDependencies?: string[];
13320 version?: string | (() => string);
13321}
13322
13323/**
13324 * Helper function for joining two ranges into a single range. This is useful
13325 * when working with AST nodes, as it allows you to combine the ranges of child nodes
13326 * to create the range of the _parent node_.
13327 */
13328declare interface ScopeInfo {
13329 definitions: StackedMap<string, ScopeInfo | VariableInfo>;
13330 topLevelScope: boolean | "arrow";
13331 inShorthand: string | boolean;
13332 inTaggedTemplateTag: boolean;
13333 inTry: boolean;
13334 isStrict: boolean;
13335 isAsmJs: boolean;
13336}
13337declare interface Selector<A, B> {
13338 (input: A): undefined | null | B;
13339}
13340declare abstract class Serializer {
13341 serializeMiddlewares: SerializerMiddleware<any, any>[];
13342 deserializeMiddlewares: SerializerMiddleware<any, any>[];
13343 context: any;
13344 serialize(obj?: any, context?: any): Promise<any>;
13345 deserialize(value?: any, context?: any): Promise<any>;
13346}
13347declare abstract class SerializerMiddleware<DeserializedType, SerializedType> {
13348 serialize(
13349 data: DeserializedType,
13350 context: object
13351 ): SerializedType | Promise<SerializedType>;
13352 deserialize(
13353 data: SerializedType,
13354 context: object
13355 ): DeserializedType | Promise<DeserializedType>;
13356}
13357type ServerOptionsHttps<
13358 Request extends typeof IncomingMessage = typeof IncomingMessage,
13359 Response extends typeof ServerResponse = typeof ServerResponse
13360> = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
13361declare class SharePlugin {
13362 constructor(options: SharePluginOptions);
13363
13364 /**
13365 * Apply the plugin
13366 */
13367 apply(compiler: Compiler): void;
13368}
13369
13370/**
13371 * Options for shared modules.
13372 */
13373declare interface SharePluginOptions {
13374 /**
13375 * Share scope name used for all shared modules (defaults to 'default').
13376 */
13377 shareScope?: string;
13378
13379 /**
13380 * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
13381 */
13382 shared: Shared;
13383}
13384type Shared = (string | SharedObject)[] | SharedObject;
13385
13386/**
13387 * Advanced configuration for modules that should be shared in the share scope.
13388 */
13389declare interface SharedConfig {
13390 /**
13391 * Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
13392 */
13393 eager?: boolean;
13394
13395 /**
13396 * Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.
13397 */
13398 import?: string | false;
13399
13400 /**
13401 * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
13402 */
13403 packageName?: string;
13404
13405 /**
13406 * Version requirement from module in share scope.
13407 */
13408 requiredVersion?: string | false;
13409
13410 /**
13411 * Module is looked up under this key from the share scope.
13412 */
13413 shareKey?: string;
13414
13415 /**
13416 * Share scope name.
13417 */
13418 shareScope?: string;
13419
13420 /**
13421 * Allow only a single version of the shared module in share scope (disabled by default).
13422 */
13423 singleton?: boolean;
13424
13425 /**
13426 * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
13427 */
13428 strictVersion?: boolean;
13429
13430 /**
13431 * Version of the provided module. Will replace lower matching versions, but not higher.
13432 */
13433 version?: string | false;
13434}
13435
13436/**
13437 * Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
13438 */
13439declare interface SharedObject {
13440 [index: string]: string | SharedConfig;
13441}
13442declare class SideEffectsFlagPlugin {
13443 constructor(analyseSource?: boolean);
13444
13445 /**
13446 * Apply the plugin
13447 */
13448 apply(compiler: Compiler): void;
13449 static moduleHasSideEffects(
13450 moduleName: string,
13451 flagValue: undefined | string | boolean | string[],
13452 cache: Map<string, RegExp>
13453 ): undefined | boolean;
13454}
13455type SimpleType = "string" | "number" | "boolean";
13456declare class SizeOnlySource extends Source {
13457 constructor(size: number);
13458}
13459declare abstract class Snapshot {
13460 startTime?: number;
13461 fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
13462 fileHashes?: Map<string, null | string>;
13463 fileTshs?: Map<string, null | string | TimestampAndHash>;
13464 contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
13465 contextHashes?: Map<string, null | string>;
13466 contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
13467 missingExistence?: Map<string, boolean>;
13468 managedItemInfo?: Map<string, string>;
13469 managedFiles?: Set<string>;
13470 managedContexts?: Set<string>;
13471 managedMissing?: Set<string>;
13472 children?: Set<Snapshot>;
13473 hasStartTime(): boolean;
13474 setStartTime(value: number): void;
13475 setMergedStartTime(value: undefined | number, snapshot: Snapshot): void;
13476 hasFileTimestamps(): boolean;
13477 setFileTimestamps(value: Map<string, null | FileSystemInfoEntry>): void;
13478 hasFileHashes(): boolean;
13479 setFileHashes(value: Map<string, null | string>): void;
13480 hasFileTshs(): boolean;
13481 setFileTshs(value: Map<string, null | string | TimestampAndHash>): void;
13482 hasContextTimestamps(): boolean;
13483 setContextTimestamps(
13484 value: Map<string, null | ResolvedContextFileSystemInfoEntry>
13485 ): void;
13486 hasContextHashes(): boolean;
13487 setContextHashes(value: Map<string, null | string>): void;
13488 hasContextTshs(): boolean;
13489 setContextTshs(
13490 value: Map<string, null | ResolvedContextTimestampAndHash>
13491 ): void;
13492 hasMissingExistence(): boolean;
13493 setMissingExistence(value: Map<string, boolean>): void;
13494 hasManagedItemInfo(): boolean;
13495 setManagedItemInfo(value: Map<string, string>): void;
13496 hasManagedFiles(): boolean;
13497 setManagedFiles(value: Set<string>): void;
13498 hasManagedContexts(): boolean;
13499 setManagedContexts(value: Set<string>): void;
13500 hasManagedMissing(): boolean;
13501 setManagedMissing(value: Set<string>): void;
13502 hasChildren(): boolean;
13503 setChildren(value: Set<Snapshot>): void;
13504 addChild(child: Snapshot): void;
13505 serialize(__0: ObjectSerializerContext): void;
13506 deserialize(__0: ObjectDeserializerContext): void;
13507 getFileIterable(): Iterable<string>;
13508 getContextIterable(): Iterable<string>;
13509 getMissingIterable(): Iterable<string>;
13510}
13511declare interface SnapshotOptionsFileSystemInfo {
13512 /**
13513 * should use hash to snapshot
13514 */
13515 hash?: boolean;
13516
13517 /**
13518 * should use timestamp to snapshot
13519 */
13520 timestamp?: boolean;
13521}
13522
13523/**
13524 * Options affecting how file system snapshots are created and validated.
13525 */
13526declare interface SnapshotOptionsWebpackOptions {
13527 /**
13528 * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
13529 */
13530 buildDependencies?: {
13531 /**
13532 * Use hashes of the content of the files/directories to determine invalidation.
13533 */
13534 hash?: boolean;
13535 /**
13536 * Use timestamps of the files/directories to determine invalidation.
13537 */
13538 timestamp?: boolean;
13539 };
13540
13541 /**
13542 * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
13543 */
13544 immutablePaths?: (string | RegExp)[];
13545
13546 /**
13547 * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
13548 */
13549 managedPaths?: (string | RegExp)[];
13550
13551 /**
13552 * Options for snapshotting dependencies of modules to determine if they need to be built again.
13553 */
13554 module?: {
13555 /**
13556 * Use hashes of the content of the files/directories to determine invalidation.
13557 */
13558 hash?: boolean;
13559 /**
13560 * Use timestamps of the files/directories to determine invalidation.
13561 */
13562 timestamp?: boolean;
13563 };
13564
13565 /**
13566 * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
13567 */
13568 resolve?: {
13569 /**
13570 * Use hashes of the content of the files/directories to determine invalidation.
13571 */
13572 hash?: boolean;
13573 /**
13574 * Use timestamps of the files/directories to determine invalidation.
13575 */
13576 timestamp?: boolean;
13577 };
13578
13579 /**
13580 * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
13581 */
13582 resolveBuildDependencies?: {
13583 /**
13584 * Use hashes of the content of the files/directories to determine invalidation.
13585 */
13586 hash?: boolean;
13587 /**
13588 * Use timestamps of the files/directories to determine invalidation.
13589 */
13590 timestamp?: boolean;
13591 };
13592
13593 /**
13594 * List of paths that are not managed by a package manager and the contents are subject to change.
13595 */
13596 unmanagedPaths?: (string | RegExp)[];
13597}
13598declare interface SortFunction<T> {
13599 (arg0: T, arg1: T): number;
13600}
13601declare abstract class SortableSet<T> extends Set<T> {
13602 /**
13603 * Sort with a comparer function
13604 */
13605 sortWith(sortFn?: SortFunction<T>): void;
13606 sort(): SortableSet<T>;
13607
13608 /**
13609 * Get data from cache
13610 */
13611 getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
13612
13613 /**
13614 * Get data from cache (ignoring sorting)
13615 */
13616 getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
13617 toJSON(): T[];
13618}
13619declare class Source {
13620 constructor();
13621 size(): number;
13622 map(options?: MapOptions): null | RawSourceMap;
13623 sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
13624 updateHash(hash: Hash): void;
13625 source(): string | Buffer;
13626 buffer(): Buffer;
13627}
13628declare interface SourceLike {
13629 source(): string | Buffer;
13630}
13631declare interface SourceMap {
13632 version: number;
13633 sources: string[];
13634 mappings: string;
13635 file?: string;
13636 sourceRoot?: string;
13637 sourcesContent?: string[];
13638 names?: string[];
13639}
13640declare class SourceMapDevToolPlugin {
13641 constructor(options?: SourceMapDevToolPluginOptions);
13642 sourceMapFilename: string | false;
13643 sourceMappingURLComment:
13644 | string
13645 | false
13646 | ((arg0: PathData, arg1?: AssetInfo) => string);
13647 moduleFilenameTemplate: string | Function;
13648 fallbackModuleFilenameTemplate: string | Function;
13649 namespace: string;
13650 options: SourceMapDevToolPluginOptions;
13651
13652 /**
13653 * Apply the plugin
13654 */
13655 apply(compiler: Compiler): void;
13656}
13657declare interface SourceMapDevToolPluginOptions {
13658 /**
13659 * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.
13660 */
13661 append?:
13662 | null
13663 | string
13664 | false
13665 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
13666
13667 /**
13668 * Indicates whether column mappings should be used (defaults to true).
13669 */
13670 columns?: boolean;
13671
13672 /**
13673 * Exclude modules that match the given value from source map generation.
13674 */
13675 exclude?: string | RegExp | Rule[];
13676
13677 /**
13678 * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict.
13679 */
13680 fallbackModuleFilenameTemplate?: string | Function;
13681
13682 /**
13683 * Path prefix to which the [file] placeholder is relative to.
13684 */
13685 fileContext?: string;
13686
13687 /**
13688 * Defines the output filename of the SourceMap (will be inlined if no value is provided).
13689 */
13690 filename?: null | string | false;
13691
13692 /**
13693 * Include source maps for module paths that match the given value.
13694 */
13695 include?: string | RegExp | Rule[];
13696
13697 /**
13698 * Indicates whether SourceMaps from loaders should be used (defaults to true).
13699 */
13700 module?: boolean;
13701
13702 /**
13703 * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
13704 */
13705 moduleFilenameTemplate?: string | Function;
13706
13707 /**
13708 * Namespace prefix to allow multiple webpack roots in the devtools.
13709 */
13710 namespace?: string;
13711
13712 /**
13713 * Omit the 'sourceContents' array from the SourceMap.
13714 */
13715 noSources?: boolean;
13716
13717 /**
13718 * Provide a custom public path for the SourceMapping comment.
13719 */
13720 publicPath?: string;
13721
13722 /**
13723 * Provide a custom value for the 'sourceRoot' property in the SourceMap.
13724 */
13725 sourceRoot?: string;
13726
13727 /**
13728 * Include source maps for modules based on their extension (defaults to .js and .css).
13729 */
13730 test?: string | RegExp | Rule[];
13731}
13732declare class SourceMapSource extends Source {
13733 constructor(
13734 source: string | Buffer,
13735 name: string,
13736 sourceMap: string | Object | Buffer,
13737 originalSource?: string | Buffer,
13738 innerSourceMap?: string | Object | Buffer,
13739 removeOriginalSource?: boolean
13740 );
13741 getArgsAsBuffers(): [
13742 Buffer,
13743 string,
13744 Buffer,
13745 undefined | Buffer,
13746 undefined | Buffer,
13747 boolean
13748 ];
13749}
13750declare interface SourcePosition {
13751 line: number;
13752 column?: number;
13753}
13754declare interface SplitChunksOptions {
13755 chunksFilter: (chunk: Chunk) => undefined | boolean;
13756 defaultSizeTypes: string[];
13757 minSize: SplitChunksSizes;
13758 minSizeReduction: SplitChunksSizes;
13759 minRemainingSize: SplitChunksSizes;
13760 enforceSizeThreshold: SplitChunksSizes;
13761 maxInitialSize: SplitChunksSizes;
13762 maxAsyncSize: SplitChunksSizes;
13763 minChunks: number;
13764 maxAsyncRequests: number;
13765 maxInitialRequests: number;
13766 hidePathInfo: boolean;
13767 filename: TemplatePath;
13768 automaticNameDelimiter: string;
13769 getCacheGroups: (
13770 module: Module,
13771 context: CacheGroupsContext
13772 ) => CacheGroupSource[];
13773 getName: (
13774 module?: Module,
13775 chunks?: Chunk[],
13776 key?: string
13777 ) => undefined | string;
13778 usedExports: boolean;
13779 fallbackCacheGroup: FallbackCacheGroup;
13780}
13781declare class SplitChunksPlugin {
13782 constructor(options?: OptimizationSplitChunksOptions);
13783 options: SplitChunksOptions;
13784
13785 /**
13786 * Apply the plugin
13787 */
13788 apply(compiler: Compiler): void;
13789}
13790declare interface SplitChunksSizes {
13791 [index: string]: number;
13792}
13793declare abstract class StackedMap<K, V> {
13794 map: Map<K, InternalCell<V>>;
13795 stack: Map<K, InternalCell<V>>[];
13796 set(item: K, value: V): void;
13797 delete(item: K): void;
13798 has(item: K): boolean;
13799 get(item: K): Cell<V>;
13800 asArray(): K[];
13801 asSet(): Set<K>;
13802 asPairArray(): [K, Cell<V>][];
13803 asMap(): Map<K, Cell<V>>;
13804 get size(): number;
13805 createChild(): StackedMap<K, V>;
13806}
13807type StartupRenderContext = RenderContext & { inlined: boolean };
13808declare interface StatFs {
13809 (
13810 path: PathLikeFs,
13811 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
13812 ): void;
13813 (
13814 path: PathLikeFs,
13815 options: undefined | (StatOptions & { bigint?: false }),
13816 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
13817 ): void;
13818 (
13819 path: PathLikeFs,
13820 options: StatOptions & { bigint: true },
13821 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
13822 ): void;
13823 (
13824 path: PathLikeFs,
13825 options: undefined | StatOptions,
13826 callback: (
13827 arg0: null | NodeJS.ErrnoException,
13828 arg1?: IStats | IBigIntStats
13829 ) => void
13830 ): void;
13831}
13832declare interface StatOptions {
13833 bigint?: boolean;
13834}
13835declare interface StatSync {
13836 (path: PathLikeFs, options?: undefined): IStats;
13837 (
13838 path: PathLikeFs,
13839 options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
13840 ): undefined | IStats;
13841 (
13842 path: PathLikeFs,
13843 options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
13844 ): undefined | IBigIntStats;
13845 (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
13846 (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
13847 (
13848 path: PathLikeFs,
13849 options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
13850 ): IStats | IBigIntStats;
13851 (
13852 path: PathLikeFs,
13853 options?: StatSyncOptions
13854 ): undefined | IStats | IBigIntStats;
13855}
13856declare interface StatSyncOptions {
13857 bigint?: boolean;
13858 throwIfNoEntry?: boolean;
13859}
13860declare interface StatTypes {
13861 (
13862 path: PathLikeTypes,
13863 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
13864 ): void;
13865 (
13866 path: PathLikeTypes,
13867 options: undefined | (StatOptions & { bigint?: false }),
13868 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
13869 ): void;
13870 (
13871 path: PathLikeTypes,
13872 options: StatOptions & { bigint: true },
13873 callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
13874 ): void;
13875 (
13876 path: PathLikeTypes,
13877 options: undefined | StatOptions,
13878 callback: (
13879 arg0: null | NodeJS.ErrnoException,
13880 arg1?: IStats | IBigIntStats
13881 ) => void
13882 ): void;
13883}
13884type Statement =
13885 | FunctionDeclaration
13886 | VariableDeclaration
13887 | ClassDeclaration
13888 | ExpressionStatement
13889 | BlockStatement
13890 | StaticBlock
13891 | EmptyStatement
13892 | DebuggerStatement
13893 | WithStatement
13894 | ReturnStatement
13895 | LabeledStatement
13896 | BreakStatement
13897 | ContinueStatement
13898 | IfStatement
13899 | SwitchStatement
13900 | ThrowStatement
13901 | TryStatement
13902 | WhileStatement
13903 | DoWhileStatement
13904 | ForStatement
13905 | ForInStatement
13906 | ForOfStatement;
13907type StatementPathItem =
13908 | UnaryExpression
13909 | ArrayExpression
13910 | ArrowFunctionExpression
13911 | AssignmentExpression
13912 | AwaitExpression
13913 | BinaryExpression
13914 | SimpleCallExpression
13915 | NewExpression
13916 | ChainExpression
13917 | ClassExpression
13918 | ConditionalExpression
13919 | FunctionExpression
13920 | Identifier
13921 | ImportExpression
13922 | SimpleLiteral
13923 | RegExpLiteral
13924 | BigIntLiteral
13925 | LogicalExpression
13926 | MemberExpression
13927 | MetaProperty
13928 | ObjectExpression
13929 | SequenceExpression
13930 | TaggedTemplateExpression
13931 | TemplateLiteral
13932 | ThisExpression
13933 | UpdateExpression
13934 | YieldExpression
13935 | FunctionDeclaration
13936 | VariableDeclaration
13937 | ClassDeclaration
13938 | ExpressionStatement
13939 | BlockStatement
13940 | StaticBlock
13941 | EmptyStatement
13942 | DebuggerStatement
13943 | WithStatement
13944 | ReturnStatement
13945 | LabeledStatement
13946 | BreakStatement
13947 | ContinueStatement
13948 | IfStatement
13949 | SwitchStatement
13950 | ThrowStatement
13951 | TryStatement
13952 | WhileStatement
13953 | DoWhileStatement
13954 | ForStatement
13955 | ForInStatement
13956 | ForOfStatement
13957 | ImportDeclaration
13958 | ExportNamedDeclaration
13959 | ExportDefaultDeclaration
13960 | ExportAllDeclaration;
13961declare class Stats {
13962 constructor(compilation: Compilation);
13963 compilation: Compilation;
13964 get hash(): string;
13965 get startTime(): number;
13966 get endTime(): number;
13967 hasWarnings(): boolean;
13968 hasErrors(): boolean;
13969 toJson(options?: string | boolean | StatsOptions): StatsCompilation;
13970 toString(options?: string | boolean | StatsOptions): string;
13971}
13972type StatsAsset = Record<string, any> & KnownStatsAsset;
13973type StatsChunk = Record<string, any> & KnownStatsChunk;
13974type StatsChunkGroup = Record<string, any> & KnownStatsChunkGroup;
13975type StatsChunkOrigin = Record<string, any> & KnownStatsChunkOrigin;
13976type StatsCompilation = Record<string, any> & KnownStatsCompilation;
13977type StatsError = Record<string, any> & KnownStatsError;
13978declare abstract class StatsFactory {
13979 hooks: StatsFactoryHooks;
13980 create(
13981 type: string,
13982 data: any,
13983 baseContext: Omit<StatsFactoryContext, "type">
13984 ): any;
13985}
13986type StatsFactoryContext = Record<string, any> & KnownStatsFactoryContext;
13987declare interface StatsFactoryHooks {
13988 extract: HookMap<
13989 SyncBailHook<[ObjectForExtract, any, StatsFactoryContext], undefined>
13990 >;
13991 filter: HookMap<
13992 SyncBailHook<
13993 [any, StatsFactoryContext, number, number],
13994 undefined | boolean
13995 >
13996 >;
13997 sort: HookMap<
13998 SyncBailHook<
13999 [((arg0?: any, arg1?: any) => 0 | 1 | -1)[], StatsFactoryContext],
14000 undefined
14001 >
14002 >;
14003 filterSorted: HookMap<
14004 SyncBailHook<
14005 [any, StatsFactoryContext, number, number],
14006 undefined | boolean
14007 >
14008 >;
14009 groupResults: HookMap<
14010 SyncBailHook<[GroupConfig[], StatsFactoryContext], undefined>
14011 >;
14012 sortResults: HookMap<
14013 SyncBailHook<
14014 [((arg0?: any, arg1?: any) => 0 | 1 | -1)[], StatsFactoryContext],
14015 undefined
14016 >
14017 >;
14018 filterResults: HookMap<
14019 SyncBailHook<
14020 [any, StatsFactoryContext, number, number],
14021 undefined | boolean
14022 >
14023 >;
14024 merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
14025 result: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
14026 getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], string>>;
14027 getItemFactory: HookMap<
14028 SyncBailHook<[any, StatsFactoryContext], undefined | StatsFactory>
14029 >;
14030}
14031type StatsLogging = Record<string, any> & KnownStatsLogging;
14032type StatsLoggingEntry = Record<string, any> & KnownStatsLoggingEntry;
14033type StatsModule = Record<string, any> & KnownStatsModule;
14034type StatsModuleIssuer = Record<string, any> & KnownStatsModuleIssuer;
14035type StatsModuleReason = Record<string, any> & KnownStatsModuleReason;
14036type StatsModuleTraceDependency = Record<string, any> &
14037 KnownStatsModuleTraceDependency;
14038type StatsModuleTraceItem = Record<string, any> & KnownStatsModuleTraceItem;
14039
14040/**
14041 * Stats options object.
14042 */
14043declare interface StatsOptions {
14044 /**
14045 * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
14046 */
14047 all?: boolean;
14048
14049 /**
14050 * Add assets information.
14051 */
14052 assets?: boolean;
14053
14054 /**
14055 * Sort the assets by that field.
14056 */
14057 assetsSort?: string;
14058
14059 /**
14060 * Space to display assets (groups will be collapsed to fit this space).
14061 */
14062 assetsSpace?: number;
14063
14064 /**
14065 * Add built at time information.
14066 */
14067 builtAt?: boolean;
14068
14069 /**
14070 * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
14071 */
14072 cached?: boolean;
14073
14074 /**
14075 * Show cached assets (setting this to `false` only shows emitted files).
14076 */
14077 cachedAssets?: boolean;
14078
14079 /**
14080 * Add information about cached (not built) modules.
14081 */
14082 cachedModules?: boolean;
14083
14084 /**
14085 * Add children information.
14086 */
14087 children?: boolean;
14088
14089 /**
14090 * Display auxiliary assets in chunk groups.
14091 */
14092 chunkGroupAuxiliary?: boolean;
14093
14094 /**
14095 * Display children of chunk groups.
14096 */
14097 chunkGroupChildren?: boolean;
14098
14099 /**
14100 * Limit of assets displayed in chunk groups.
14101 */
14102 chunkGroupMaxAssets?: number;
14103
14104 /**
14105 * Display all chunk groups with the corresponding bundles.
14106 */
14107 chunkGroups?: boolean;
14108
14109 /**
14110 * Add built modules information to chunk information.
14111 */
14112 chunkModules?: boolean;
14113
14114 /**
14115 * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
14116 */
14117 chunkModulesSpace?: number;
14118
14119 /**
14120 * Add the origins of chunks and chunk merging info.
14121 */
14122 chunkOrigins?: boolean;
14123
14124 /**
14125 * Add information about parent, children and sibling chunks to chunk information.
14126 */
14127 chunkRelations?: boolean;
14128
14129 /**
14130 * Add chunk information.
14131 */
14132 chunks?: boolean;
14133
14134 /**
14135 * Sort the chunks by that field.
14136 */
14137 chunksSort?: string;
14138
14139 /**
14140 * Enables/Disables colorful output.
14141 */
14142 colors?:
14143 | boolean
14144 | {
14145 /**
14146 * Custom color for bold text.
14147 */
14148 bold?: string;
14149 /**
14150 * Custom color for cyan text.
14151 */
14152 cyan?: string;
14153 /**
14154 * Custom color for green text.
14155 */
14156 green?: string;
14157 /**
14158 * Custom color for magenta text.
14159 */
14160 magenta?: string;
14161 /**
14162 * Custom color for red text.
14163 */
14164 red?: string;
14165 /**
14166 * Custom color for yellow text.
14167 */
14168 yellow?: string;
14169 };
14170
14171 /**
14172 * Context directory for request shortening.
14173 */
14174 context?: string;
14175
14176 /**
14177 * Show chunk modules that are dependencies of other modules of the chunk.
14178 */
14179 dependentModules?: boolean;
14180
14181 /**
14182 * Add module depth in module graph.
14183 */
14184 depth?: boolean;
14185
14186 /**
14187 * Display the entry points with the corresponding bundles.
14188 */
14189 entrypoints?: boolean | "auto";
14190
14191 /**
14192 * Add --env information.
14193 */
14194 env?: boolean;
14195
14196 /**
14197 * Add details to errors (like resolving log).
14198 */
14199 errorDetails?: boolean | "auto";
14200
14201 /**
14202 * Add internal stack trace to errors.
14203 */
14204 errorStack?: boolean;
14205
14206 /**
14207 * Add errors.
14208 */
14209 errors?: boolean;
14210
14211 /**
14212 * Add errors count.
14213 */
14214 errorsCount?: boolean;
14215
14216 /**
14217 * Space to display errors (value is in number of lines).
14218 */
14219 errorsSpace?: number;
14220
14221 /**
14222 * Please use excludeModules instead.
14223 */
14224 exclude?:
14225 | string
14226 | boolean
14227 | RegExp
14228 | ModuleFilterItemTypes[]
14229 | ((
14230 name: string,
14231 module: StatsModule,
14232 type: "module" | "chunk" | "root-of-chunk" | "nested"
14233 ) => boolean);
14234
14235 /**
14236 * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
14237 */
14238 excludeAssets?:
14239 | string
14240 | RegExp
14241 | AssetFilterItemTypes[]
14242 | ((name: string, asset: StatsAsset) => boolean);
14243
14244 /**
14245 * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
14246 */
14247 excludeModules?:
14248 | string
14249 | boolean
14250 | RegExp
14251 | ModuleFilterItemTypes[]
14252 | ((
14253 name: string,
14254 module: StatsModule,
14255 type: "module" | "chunk" | "root-of-chunk" | "nested"
14256 ) => boolean);
14257
14258 /**
14259 * Group assets by how their are related to chunks.
14260 */
14261 groupAssetsByChunk?: boolean;
14262
14263 /**
14264 * Group assets by their status (emitted, compared for emit or cached).
14265 */
14266 groupAssetsByEmitStatus?: boolean;
14267
14268 /**
14269 * Group assets by their extension.
14270 */
14271 groupAssetsByExtension?: boolean;
14272
14273 /**
14274 * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
14275 */
14276 groupAssetsByInfo?: boolean;
14277
14278 /**
14279 * Group assets by their path.
14280 */
14281 groupAssetsByPath?: boolean;
14282
14283 /**
14284 * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
14285 */
14286 groupModulesByAttributes?: boolean;
14287
14288 /**
14289 * Group modules by their status (cached or built and cacheable).
14290 */
14291 groupModulesByCacheStatus?: boolean;
14292
14293 /**
14294 * Group modules by their extension.
14295 */
14296 groupModulesByExtension?: boolean;
14297
14298 /**
14299 * Group modules by their layer.
14300 */
14301 groupModulesByLayer?: boolean;
14302
14303 /**
14304 * Group modules by their path.
14305 */
14306 groupModulesByPath?: boolean;
14307
14308 /**
14309 * Group modules by their type.
14310 */
14311 groupModulesByType?: boolean;
14312
14313 /**
14314 * Group reasons by their origin module.
14315 */
14316 groupReasonsByOrigin?: boolean;
14317
14318 /**
14319 * Add the hash of the compilation.
14320 */
14321 hash?: boolean;
14322
14323 /**
14324 * Add ids.
14325 */
14326 ids?: boolean;
14327
14328 /**
14329 * Add logging output.
14330 */
14331 logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
14332
14333 /**
14334 * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
14335 */
14336 loggingDebug?:
14337 | string
14338 | boolean
14339 | RegExp
14340 | FilterItemTypes[]
14341 | ((value: string) => boolean);
14342
14343 /**
14344 * Add stack traces to logging output.
14345 */
14346 loggingTrace?: boolean;
14347
14348 /**
14349 * Add information about assets inside modules.
14350 */
14351 moduleAssets?: boolean;
14352
14353 /**
14354 * Add dependencies and origin of warnings/errors.
14355 */
14356 moduleTrace?: boolean;
14357
14358 /**
14359 * Add built modules information.
14360 */
14361 modules?: boolean;
14362
14363 /**
14364 * Sort the modules by that field.
14365 */
14366 modulesSort?: string;
14367
14368 /**
14369 * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
14370 */
14371 modulesSpace?: number;
14372
14373 /**
14374 * Add information about modules nested in other modules (like with module concatenation).
14375 */
14376 nestedModules?: boolean;
14377
14378 /**
14379 * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
14380 */
14381 nestedModulesSpace?: number;
14382
14383 /**
14384 * Show reasons why optimization bailed out for modules.
14385 */
14386 optimizationBailout?: boolean;
14387
14388 /**
14389 * Add information about orphan modules.
14390 */
14391 orphanModules?: boolean;
14392
14393 /**
14394 * Add output path information.
14395 */
14396 outputPath?: boolean;
14397
14398 /**
14399 * Add performance hint flags.
14400 */
14401 performance?: boolean;
14402
14403 /**
14404 * Preset for the default values.
14405 */
14406 preset?: string | boolean;
14407
14408 /**
14409 * Show exports provided by modules.
14410 */
14411 providedExports?: boolean;
14412
14413 /**
14414 * Add public path information.
14415 */
14416 publicPath?: boolean;
14417
14418 /**
14419 * Add information about the reasons why modules are included.
14420 */
14421 reasons?: boolean;
14422
14423 /**
14424 * Space to display reasons (groups will be collapsed to fit this space).
14425 */
14426 reasonsSpace?: number;
14427
14428 /**
14429 * Add information about assets that are related to other assets (like SourceMaps for assets).
14430 */
14431 relatedAssets?: boolean;
14432
14433 /**
14434 * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
14435 */
14436 runtime?: boolean;
14437
14438 /**
14439 * Add information about runtime modules.
14440 */
14441 runtimeModules?: boolean;
14442
14443 /**
14444 * Add the source code of modules.
14445 */
14446 source?: boolean;
14447
14448 /**
14449 * Add timing information.
14450 */
14451 timings?: boolean;
14452
14453 /**
14454 * Show exports used by modules.
14455 */
14456 usedExports?: boolean;
14457
14458 /**
14459 * Add webpack version information.
14460 */
14461 version?: boolean;
14462
14463 /**
14464 * Add warnings.
14465 */
14466 warnings?: boolean;
14467
14468 /**
14469 * Add warnings count.
14470 */
14471 warningsCount?: boolean;
14472
14473 /**
14474 * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
14475 */
14476 warningsFilter?:
14477 | string
14478 | RegExp
14479 | WarningFilterItemTypes[]
14480 | ((warning: StatsError, value: string) => boolean);
14481
14482 /**
14483 * Space to display warnings (value is in number of lines).
14484 */
14485 warningsSpace?: number;
14486}
14487declare interface StatsPrintHooks {
14488 sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], void>>;
14489 printElements: HookMap<
14490 SyncBailHook<[PrintedElement[], StatsPrinterContext], undefined | string>
14491 >;
14492 sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
14493 getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
14494 printItems: HookMap<
14495 SyncBailHook<[string[], StatsPrinterContext], undefined | string>
14496 >;
14497 print: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
14498 result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
14499}
14500declare abstract class StatsPrinter {
14501 hooks: StatsPrintHooks;
14502 print(type: string, object?: any, baseContext?: StatsPrinterContext): string;
14503}
14504type StatsPrinterContext = Record<string, any> &
14505 KnownStatsPrinterColorFn &
14506 KnownStatsPrinterFormaters &
14507 KnownStatsPrinterContext;
14508type StatsProfile = Record<string, any> & KnownStatsProfile;
14509type StatsValue =
14510 | boolean
14511 | StatsOptions
14512 | "none"
14513 | "verbose"
14514 | "summary"
14515 | "errors-only"
14516 | "errors-warnings"
14517 | "minimal"
14518 | "normal"
14519 | "detailed";
14520declare class SyncModuleIdsPlugin {
14521 constructor(__0: {
14522 /**
14523 * path to file
14524 */
14525 path: string;
14526 /**
14527 * context for module names
14528 */
14529 context?: string;
14530 /**
14531 * selector for modules
14532 */
14533 test: (arg0: Module) => boolean;
14534 /**
14535 * operation mode (defaults to merge)
14536 */
14537 mode?: "read" | "create" | "merge" | "update";
14538 });
14539
14540 /**
14541 * Apply the plugin
14542 */
14543 apply(compiler: Compiler): void;
14544}
14545declare interface SyntheticDependencyLocation {
14546 name: string;
14547 index?: number;
14548}
14549declare const TOMBSTONE: unique symbol;
14550declare const TRANSITIVE: unique symbol;
14551declare const TRANSITIVE_ONLY: unique symbol;
14552
14553/**
14554 * Helper function for joining two ranges into a single range. This is useful
14555 * when working with AST nodes, as it allows you to combine the ranges of child nodes
14556 * to create the range of the _parent node_.
14557 */
14558declare interface TagInfo {
14559 tag: any;
14560 data: any;
14561 next?: TagInfo;
14562}
14563declare interface TargetItem {
14564 module: Module;
14565 connection: ModuleGraphConnection;
14566 export?: string[];
14567}
14568declare interface TargetItemWithoutConnection {
14569 module: Module;
14570 export: string[];
14571}
14572declare class Template {
14573 constructor();
14574 static getFunctionContent(fn: Function): string;
14575 static toIdentifier(str: string): string;
14576 static toComment(str: string): string;
14577 static toNormalComment(str: string): string;
14578 static toPath(str: string): string;
14579 static numberToIdentifier(n: number): string;
14580 static numberToIdentifierContinuation(n: number): string;
14581 static indent(s: string | string[]): string;
14582 static prefix(s: string | string[], prefix: string): string;
14583 static asString(str: string | string[]): string;
14584 static getModulesArrayBounds(modules: WithId[]): false | [number, number];
14585 static renderChunkModules(
14586 renderContext: ChunkRenderContext,
14587 modules: Module[],
14588 renderModule: (arg0: Module) => null | Source,
14589 prefix?: string
14590 ): null | Source;
14591 static renderRuntimeModules(
14592 runtimeModules: RuntimeModule[],
14593 renderContext: RenderContext & {
14594 codeGenerationResults?: CodeGenerationResults;
14595 }
14596 ): Source;
14597 static renderChunkRuntimeModules(
14598 runtimeModules: RuntimeModule[],
14599 renderContext: RenderContext
14600 ): Source;
14601 static NUMBER_OF_IDENTIFIER_START_CHARS: number;
14602 static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
14603}
14604type TemplatePath = string | ((arg0: PathData, arg1?: AssetInfo) => string);
14605declare interface TimestampAndHash {
14606 safeTime: number;
14607 timestamp?: number;
14608 hash: string;
14609}
14610declare class TopLevelSymbol {
14611 constructor(name: string);
14612 name: string;
14613}
14614
14615/**
14616 * Use a Trusted Types policy to create urls for chunks.
14617 */
14618declare interface TrustedTypes {
14619 /**
14620 * If the call to `trustedTypes.createPolicy(...)` fails -- e.g., due to the policy name missing from the CSP `trusted-types` list, or it being a duplicate name, etc. -- controls whether to continue with loading in the hope that `require-trusted-types-for 'script'` isn't enforced yet, versus fail immediately. Default behavior is 'stop'.
14621 */
14622 onPolicyCreationFailure?: "continue" | "stop";
14623
14624 /**
14625 * The name of the Trusted Types policy created by webpack to serve bundle chunks.
14626 */
14627 policyName?: string;
14628}
14629declare const UNDEFINED_MARKER: unique symbol;
14630
14631/**
14632 * `URL` class is a global reference for `require('url').URL`
14633 * https://nodejs.org/api/url.html#the-whatwg-url-api
14634 */
14635declare interface URL_url extends URL {}
14636declare interface UnsafeCacheData {
14637 factoryMeta?: FactoryMeta;
14638 resolveOptions?: ResolveOptions;
14639}
14640declare interface UpdateHashContextDependency {
14641 chunkGraph: ChunkGraph;
14642 runtime: RuntimeSpec;
14643 runtimeTemplate?: RuntimeTemplate;
14644}
14645declare interface UpdateHashContextGenerator {
14646 /**
14647 * the module
14648 */
14649 module: NormalModule;
14650 chunkGraph: ChunkGraph;
14651 runtime: RuntimeSpec;
14652 runtimeTemplate?: RuntimeTemplate;
14653}
14654type UsageStateType = 0 | 1 | 2 | 3 | 4;
14655type UsedName = string | false | string[];
14656type Value = string | number | boolean | RegExp;
14657type ValueCacheVersion = undefined | string | Set<string>;
14658declare abstract class VariableInfo {
14659 declaredScope: ScopeInfo;
14660 freeName?: string | true;
14661 tagInfo?: TagInfo;
14662}
14663declare interface VariableInfoInterface {
14664 declaredScope: ScopeInfo;
14665 freeName: string | true;
14666 tagInfo?: TagInfo;
14667}
14668type WarningFilterItemTypes =
14669 | string
14670 | RegExp
14671 | ((warning: StatsError, value: string) => boolean);
14672declare interface WatchFileSystem {
14673 watch: (
14674 files: Iterable<string>,
14675 directories: Iterable<string>,
14676 missing: Iterable<string>,
14677 startTime: number,
14678 options: WatchOptions,
14679 callback: (
14680 arg0: null | Error,
14681 arg1?: Map<string, FileSystemInfoEntry | "ignore">,
14682 arg2?: Map<string, FileSystemInfoEntry | "ignore">,
14683 arg3?: Set<string>,
14684 arg4?: Set<string>
14685 ) => void,
14686 callbackUndelayed: (arg0: string, arg1: number) => void
14687 ) => Watcher;
14688}
14689declare class WatchIgnorePlugin {
14690 constructor(options: WatchIgnorePluginOptions);
14691 paths: (string | RegExp)[];
14692
14693 /**
14694 * Apply the plugin
14695 */
14696 apply(compiler: Compiler): void;
14697}
14698declare interface WatchIgnorePluginOptions {
14699 /**
14700 * A list of RegExps or absolute paths to directories or files that should be ignored.
14701 */
14702 paths: (string | RegExp)[];
14703}
14704
14705/**
14706 * Options for the watcher.
14707 */
14708declare interface WatchOptions {
14709 /**
14710 * Delay the rebuilt after the first change. Value is a time in ms.
14711 */
14712 aggregateTimeout?: number;
14713
14714 /**
14715 * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
14716 */
14717 followSymlinks?: boolean;
14718
14719 /**
14720 * Ignore some files from watching (glob pattern or regexp).
14721 */
14722 ignored?: string | RegExp | string[];
14723
14724 /**
14725 * Enable polling mode for watching.
14726 */
14727 poll?: number | boolean;
14728
14729 /**
14730 * Stop watching when stdin stream has ended.
14731 */
14732 stdin?: boolean;
14733}
14734declare interface Watcher {
14735 /**
14736 * closes the watcher and all underlying file watchers
14737 */
14738 close: () => void;
14739
14740 /**
14741 * closes the watcher, but keeps underlying file watchers alive until the next watch call
14742 */
14743 pause: () => void;
14744
14745 /**
14746 * get current aggregated changes that have not yet send to callback
14747 */
14748 getAggregatedChanges?: () => Set<string>;
14749
14750 /**
14751 * get current aggregated removals that have not yet send to callback
14752 */
14753 getAggregatedRemovals?: () => Set<string>;
14754
14755 /**
14756 * get info about files
14757 */
14758 getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
14759
14760 /**
14761 * get info about directories
14762 */
14763 getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
14764
14765 /**
14766 * get info about timestamps and changes
14767 */
14768 getInfo?: () => WatcherInfo;
14769}
14770declare interface WatcherInfo {
14771 /**
14772 * get current aggregated changes that have not yet send to callback
14773 */
14774 changes: Set<string>;
14775
14776 /**
14777 * get current aggregated removals that have not yet send to callback
14778 */
14779 removals: Set<string>;
14780
14781 /**
14782 * get info about files
14783 */
14784 fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
14785
14786 /**
14787 * get info about directories
14788 */
14789 contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
14790}
14791declare abstract class Watching {
14792 startTime: null | number;
14793 invalid: boolean;
14794 handler: CallbackFunction_1<Stats>;
14795 callbacks: CallbackFunction_1<void>[];
14796 closed: boolean;
14797 suspended: boolean;
14798 blocked: boolean;
14799 watchOptions: WatchOptions;
14800 compiler: Compiler;
14801 running: boolean;
14802 watcher?: null | Watcher;
14803 pausedWatcher?: null | Watcher;
14804 lastWatcherStartTime?: number;
14805 watch(
14806 files: Iterable<string>,
14807 dirs: Iterable<string>,
14808 missing: Iterable<string>
14809 ): void;
14810 invalidate(callback?: CallbackFunction_1<void>): void;
14811 suspend(): void;
14812 resume(): void;
14813 close(callback: CallbackFunction_1<void>): void;
14814}
14815declare abstract class WeakTupleMap<T extends any[], V> {
14816 set(...args: [T, ...V[]]): void;
14817 has(...args: T): boolean;
14818 get(...args: T): undefined | V;
14819 provide(...args: [T, ...(() => V)[]]): V;
14820 delete(...args: T): void;
14821 clear(): void;
14822}
14823declare interface WebAssemblyRenderContext {
14824 /**
14825 * the chunk
14826 */
14827 chunk: Chunk;
14828
14829 /**
14830 * the dependency templates
14831 */
14832 dependencyTemplates: DependencyTemplates;
14833
14834 /**
14835 * the runtime template
14836 */
14837 runtimeTemplate: RuntimeTemplate;
14838
14839 /**
14840 * the module graph
14841 */
14842 moduleGraph: ModuleGraph;
14843
14844 /**
14845 * the chunk graph
14846 */
14847 chunkGraph: ChunkGraph;
14848
14849 /**
14850 * results of code generation
14851 */
14852 codeGenerationResults: CodeGenerationResults;
14853}
14854declare class WebWorkerTemplatePlugin {
14855 constructor();
14856
14857 /**
14858 * Apply the plugin
14859 */
14860 apply(compiler: Compiler): void;
14861}
14862declare class WebpackError extends Error {
14863 /**
14864 * Creates an instance of WebpackError.
14865 */
14866 constructor(message?: string);
14867 details?: string;
14868 module?: null | Module;
14869 loc?: SyntheticDependencyLocation | RealDependencyLocation;
14870 hideStack?: boolean;
14871 chunk?: Chunk;
14872 file?: string;
14873 serialize(__0: ObjectSerializerContext): void;
14874 deserialize(__0: ObjectDeserializerContext): void;
14875
14876 /**
14877 * Create .stack property on a target object
14878 */
14879 static captureStackTrace(
14880 targetObject: object,
14881 constructorOpt?: Function
14882 ): void;
14883
14884 /**
14885 * Optional override for formatting stack traces
14886 */
14887 static prepareStackTrace?: (
14888 err: Error,
14889 stackTraces: NodeJS.CallSite[]
14890 ) => any;
14891 static stackTraceLimit: number;
14892}
14893declare abstract class WebpackLogger {
14894 getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
14895 error(...args: any[]): void;
14896 warn(...args: any[]): void;
14897 info(...args: any[]): void;
14898 log(...args: any[]): void;
14899 debug(...args: any[]): void;
14900 assert(assertion: any, ...args: any[]): void;
14901 trace(): void;
14902 clear(): void;
14903 status(...args: any[]): void;
14904 group(...args: any[]): void;
14905 groupCollapsed(...args: any[]): void;
14906 groupEnd(): void;
14907 profile(label?: string): void;
14908 profileEnd(label?: string): void;
14909 time(label: string): void;
14910 timeLog(label?: string): void;
14911 timeEnd(label?: string): void;
14912 timeAggregate(label?: string): void;
14913 timeAggregateEnd(label?: string): void;
14914}
14915declare class WebpackOptionsApply extends OptionsApply {
14916 constructor();
14917}
14918declare class WebpackOptionsDefaulter {
14919 constructor();
14920 process(options: Configuration): WebpackOptionsNormalized;
14921}
14922
14923/**
14924 * Normalized webpack options object.
14925 */
14926declare interface WebpackOptionsNormalized {
14927 /**
14928 * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
14929 */
14930 amd?: false | { [index: string]: any };
14931
14932 /**
14933 * Report the first error as a hard error instead of tolerating it.
14934 */
14935 bail?: boolean;
14936
14937 /**
14938 * Cache generated modules and chunks to improve performance for multiple incremental builds.
14939 */
14940 cache: CacheOptionsNormalized;
14941
14942 /**
14943 * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
14944 */
14945 context?: string;
14946
14947 /**
14948 * References to other configurations to depend on.
14949 */
14950 dependencies?: string[];
14951
14952 /**
14953 * Options for the webpack-dev-server.
14954 */
14955 devServer?: false | { [index: string]: any };
14956
14957 /**
14958 * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
14959 */
14960 devtool?: string | false;
14961
14962 /**
14963 * The entry point(s) of the compilation.
14964 */
14965 entry: EntryNormalized;
14966
14967 /**
14968 * Enables/Disables experiments (experimental features with relax SemVer compatibility).
14969 */
14970 experiments: ExperimentsNormalized;
14971
14972 /**
14973 * 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`.
14974 */
14975 externals: Externals;
14976
14977 /**
14978 * Enable presets of externals for specific targets.
14979 */
14980 externalsPresets: ExternalsPresets;
14981
14982 /**
14983 * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
14984 */
14985 externalsType?:
14986 | "import"
14987 | "var"
14988 | "module"
14989 | "assign"
14990 | "this"
14991 | "window"
14992 | "self"
14993 | "global"
14994 | "commonjs"
14995 | "commonjs2"
14996 | "commonjs-module"
14997 | "commonjs-static"
14998 | "amd"
14999 | "amd-require"
15000 | "umd"
15001 | "umd2"
15002 | "jsonp"
15003 | "system"
15004 | "promise"
15005 | "module-import"
15006 | "script"
15007 | "node-commonjs";
15008
15009 /**
15010 * Ignore specific warnings.
15011 */
15012 ignoreWarnings?: ((
15013 warning: WebpackError,
15014 compilation: Compilation
15015 ) => boolean)[];
15016
15017 /**
15018 * Options for infrastructure level logging.
15019 */
15020 infrastructureLogging: InfrastructureLogging;
15021
15022 /**
15023 * Custom values available in the loader context.
15024 */
15025 loader?: Loader;
15026
15027 /**
15028 * Enable production optimizations or development hints.
15029 */
15030 mode?: "none" | "development" | "production";
15031
15032 /**
15033 * Options affecting the normal modules (`NormalModuleFactory`).
15034 */
15035 module: ModuleOptionsNormalized;
15036
15037 /**
15038 * Name of the configuration. Used when loading multiple configurations.
15039 */
15040 name?: string;
15041
15042 /**
15043 * Include polyfills or mocks for various node stuff.
15044 */
15045 node: Node;
15046
15047 /**
15048 * Enables/Disables integrated optimizations.
15049 */
15050 optimization: Optimization;
15051
15052 /**
15053 * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
15054 */
15055 output: OutputNormalized;
15056
15057 /**
15058 * The number of parallel processed modules in the compilation.
15059 */
15060 parallelism?: number;
15061
15062 /**
15063 * Configuration for web performance recommendations.
15064 */
15065 performance?: false | PerformanceOptions;
15066
15067 /**
15068 * Add additional plugins to the compiler.
15069 */
15070 plugins: (
15071 | undefined
15072 | null
15073 | false
15074 | ""
15075 | 0
15076 | ((this: Compiler, compiler: Compiler) => void)
15077 | WebpackPluginInstance
15078 )[];
15079
15080 /**
15081 * Capture timing information for each module.
15082 */
15083 profile?: boolean;
15084
15085 /**
15086 * Store compiler state to a json file.
15087 */
15088 recordsInputPath?: string | false;
15089
15090 /**
15091 * Load compiler state from a json file.
15092 */
15093 recordsOutputPath?: string | false;
15094
15095 /**
15096 * Options for the resolver.
15097 */
15098 resolve: ResolveOptions;
15099
15100 /**
15101 * Options for the resolver when resolving loaders.
15102 */
15103 resolveLoader: ResolveOptions;
15104
15105 /**
15106 * Options affecting how file system snapshots are created and validated.
15107 */
15108 snapshot: SnapshotOptionsWebpackOptions;
15109
15110 /**
15111 * Stats options object or preset name.
15112 */
15113 stats: StatsValue;
15114
15115 /**
15116 * Environment to build for. An array of environments to build for all of them when possible.
15117 */
15118 target?: string | false | string[];
15119
15120 /**
15121 * Enter watch mode, which rebuilds on file change.
15122 */
15123 watch?: boolean;
15124
15125 /**
15126 * Options for the watcher.
15127 */
15128 watchOptions: WatchOptions;
15129}
15130
15131/**
15132 * Plugin instance.
15133 */
15134declare interface WebpackPluginInstance {
15135 [index: string]: any;
15136
15137 /**
15138 * The run point of the plugin, required method.
15139 */
15140 apply: (compiler: Compiler) => void;
15141}
15142declare interface WithId {
15143 id: string | number;
15144}
15145declare interface WithOptions {
15146 /**
15147 * create a resolver with additional/different options
15148 */
15149 withOptions: (
15150 arg0: Partial<ResolveOptionsWithDependencyType>
15151 ) => ResolverWithOptions;
15152}
15153declare interface WriteFile {
15154 (
15155 file: PathOrFileDescriptorFs,
15156 data:
15157 | string
15158 | Uint8Array
15159 | Uint8ClampedArray
15160 | Uint16Array
15161 | Uint32Array
15162 | Int8Array
15163 | Int16Array
15164 | Int32Array
15165 | BigUint64Array
15166 | BigInt64Array
15167 | Float32Array
15168 | Float64Array
15169 | DataView,
15170 options: WriteFileOptions,
15171 callback: (arg0: null | NodeJS.ErrnoException) => void
15172 ): void;
15173 (
15174 file: PathOrFileDescriptorFs,
15175 data:
15176 | string
15177 | Uint8Array
15178 | Uint8ClampedArray
15179 | Uint16Array
15180 | Uint32Array
15181 | Int8Array
15182 | Int16Array
15183 | Int32Array
15184 | BigUint64Array
15185 | BigInt64Array
15186 | Float32Array
15187 | Float64Array
15188 | DataView,
15189 callback: (arg0: null | NodeJS.ErrnoException) => void
15190 ): void;
15191}
15192type WriteFileOptions =
15193 | null
15194 | "ascii"
15195 | "utf8"
15196 | "utf-8"
15197 | "utf16le"
15198 | "utf-16le"
15199 | "ucs2"
15200 | "ucs-2"
15201 | "latin1"
15202 | "binary"
15203 | "base64"
15204 | "base64url"
15205 | "hex"
15206 | (ObjectEncodingOptions &
15207 Abortable & { mode?: string | number; flag?: string; flush?: boolean });
15208declare interface WriteOnlySet<T> {
15209 add: (item: T) => void;
15210}
15211
15212declare interface WriteStreamOptions {
15213 flags?: string;
15214 encoding?:
15215 | "ascii"
15216 | "utf8"
15217 | "utf-8"
15218 | "utf16le"
15219 | "utf-16le"
15220 | "ucs2"
15221 | "ucs-2"
15222 | "latin1"
15223 | "binary"
15224 | "base64"
15225 | "base64url"
15226 | "hex";
15227 fd?: any;
15228 mode?: number;
15229 autoClose?: boolean;
15230 emitClose?: boolean;
15231 start?: number;
15232 signal?: null | AbortSignal;
15233 fs?: null | CreateWriteStreamFSImplementation;
15234}
15235type __TypeWebpackOptions = (data: object) =>
15236 | string
15237 | {
15238 /**
15239 * Unique loader options identifier.
15240 */
15241 ident?: string;
15242 /**
15243 * Loader name.
15244 */
15245 loader?: string;
15246 /**
15247 * Loader options.
15248 */
15249 options?: string | { [index: string]: any };
15250 }
15251 | __TypeWebpackOptions
15252 | __Type_2[];
15253type __Type_2 =
15254 | undefined
15255 | null
15256 | string
15257 | false
15258 | 0
15259 | {
15260 /**
15261 * Unique loader options identifier.
15262 */
15263 ident?: string;
15264 /**
15265 * Loader name.
15266 */
15267 loader?: string;
15268 /**
15269 * Loader options.
15270 */
15271 options?: string | { [index: string]: any };
15272 }
15273 | ((data: object) =>
15274 | string
15275 | {
15276 /**
15277 * Unique loader options identifier.
15278 */
15279 ident?: string;
15280 /**
15281 * Loader name.
15282 */
15283 loader?: string;
15284 /**
15285 * Loader options.
15286 */
15287 options?: string | { [index: string]: any };
15288 }
15289 | __TypeWebpackOptions
15290 | __Type_2[]);
15291declare function exports(
15292 options: Configuration,
15293 callback?: CallbackWebpack<Stats>
15294): Compiler;
15295declare function exports(
15296 options: ReadonlyArray<Configuration> & MultiCompilerOptions,
15297 callback?: CallbackWebpack<MultiStats>
15298): MultiCompiler;
15299declare namespace exports {
15300 export const webpack: {
15301 (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
15302 (
15303 options: ReadonlyArray<Configuration> & MultiCompilerOptions,
15304 callback?: CallbackWebpack<MultiStats>
15305 ): MultiCompiler;
15306 };
15307 export const validate: (options?: any) => void;
15308 export const validateSchema: (
15309 schema: Parameters<typeof validateFunction>[0],
15310 options: Parameters<typeof validateFunction>[1],
15311 validationConfiguration?: ValidationErrorConfiguration
15312 ) => void;
15313 export const version: string;
15314 export namespace cli {
15315 export let getArguments: (schema?: any) => Flags;
15316 export let processArguments: (
15317 args: Flags,
15318 config: any,
15319 values: Record<string, Value[]>
15320 ) => null | Problem[];
15321 }
15322 export namespace ModuleFilenameHelpers {
15323 export let ALL_LOADERS_RESOURCE: string;
15324 export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
15325 export let LOADERS_RESOURCE: string;
15326 export let REGEXP_LOADERS_RESOURCE: RegExp;
15327 export let RESOURCE: string;
15328 export let REGEXP_RESOURCE: RegExp;
15329 export let ABSOLUTE_RESOURCE_PATH: string;
15330 export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
15331 export let RESOURCE_PATH: string;
15332 export let REGEXP_RESOURCE_PATH: RegExp;
15333 export let ALL_LOADERS: string;
15334 export let REGEXP_ALL_LOADERS: RegExp;
15335 export let LOADERS: string;
15336 export let REGEXP_LOADERS: RegExp;
15337 export let QUERY: string;
15338 export let REGEXP_QUERY: RegExp;
15339 export let ID: string;
15340 export let REGEXP_ID: RegExp;
15341 export let HASH: string;
15342 export let REGEXP_HASH: RegExp;
15343 export let NAMESPACE: string;
15344 export let REGEXP_NAMESPACE: RegExp;
15345 export let createFilename: (
15346 module: string | Module,
15347 options: any,
15348 __2: {
15349 /**
15350 * requestShortener
15351 */
15352 requestShortener: RequestShortener;
15353 /**
15354 * chunk graph
15355 */
15356 chunkGraph: ChunkGraph;
15357 /**
15358 * the hash function to use
15359 */
15360 hashFunction?: string | typeof Hash;
15361 }
15362 ) => string;
15363 export let replaceDuplicates: <T>(
15364 array: T[],
15365 fn: (
15366 duplicateItem: T,
15367 duplicateItemIndex: number,
15368 numberOfTimesReplaced: number
15369 ) => T,
15370 comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
15371 ) => T[];
15372 export let matchPart: (str: string, test: Matcher) => boolean;
15373 export let matchObject: (obj: MatchObject, str: string) => boolean;
15374 }
15375 export namespace OptimizationStages {
15376 export let STAGE_BASIC: -10;
15377 export let STAGE_DEFAULT: 0;
15378 export let STAGE_ADVANCED: 10;
15379 }
15380 export namespace RuntimeGlobals {
15381 export let require: "__webpack_require__";
15382 export let requireScope: "__webpack_require__.*";
15383 export let exports: "__webpack_exports__";
15384 export let thisAsExports: "top-level-this-exports";
15385 export let returnExportsFromRuntime: "return-exports-from-runtime";
15386 export let module: "module";
15387 export let moduleId: "module.id";
15388 export let moduleLoaded: "module.loaded";
15389 export let publicPath: "__webpack_require__.p";
15390 export let entryModuleId: "__webpack_require__.s";
15391 export let moduleCache: "__webpack_require__.c";
15392 export let moduleFactories: "__webpack_require__.m";
15393 export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
15394 export let ensureChunk: "__webpack_require__.e";
15395 export let ensureChunkHandlers: "__webpack_require__.f";
15396 export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
15397 export let prefetchChunk: "__webpack_require__.E";
15398 export let prefetchChunkHandlers: "__webpack_require__.F";
15399 export let preloadChunk: "__webpack_require__.G";
15400 export let preloadChunkHandlers: "__webpack_require__.H";
15401 export let definePropertyGetters: "__webpack_require__.d";
15402 export let makeNamespaceObject: "__webpack_require__.r";
15403 export let createFakeNamespaceObject: "__webpack_require__.t";
15404 export let compatGetDefaultExport: "__webpack_require__.n";
15405 export let harmonyModuleDecorator: "__webpack_require__.hmd";
15406 export let nodeModuleDecorator: "__webpack_require__.nmd";
15407 export let getFullHash: "__webpack_require__.h";
15408 export let wasmInstances: "__webpack_require__.w";
15409 export let instantiateWasm: "__webpack_require__.v";
15410 export let uncaughtErrorHandler: "__webpack_require__.oe";
15411 export let scriptNonce: "__webpack_require__.nc";
15412 export let loadScript: "__webpack_require__.l";
15413 export let createScript: "__webpack_require__.ts";
15414 export let createScriptUrl: "__webpack_require__.tu";
15415 export let getTrustedTypesPolicy: "__webpack_require__.tt";
15416 export let hasFetchPriority: "has fetch priority";
15417 export let chunkName: "__webpack_require__.cn";
15418 export let runtimeId: "__webpack_require__.j";
15419 export let getChunkScriptFilename: "__webpack_require__.u";
15420 export let getChunkCssFilename: "__webpack_require__.k";
15421 export let hasCssModules: "has css modules";
15422 export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
15423 export let getChunkUpdateCssFilename: "__webpack_require__.hk";
15424 export let startup: "__webpack_require__.x";
15425 export let startupNoDefault: "__webpack_require__.x (no default handler)";
15426 export let startupOnlyAfter: "__webpack_require__.x (only after)";
15427 export let startupOnlyBefore: "__webpack_require__.x (only before)";
15428 export let chunkCallback: "webpackChunk";
15429 export let startupEntrypoint: "__webpack_require__.X";
15430 export let onChunksLoaded: "__webpack_require__.O";
15431 export let externalInstallChunk: "__webpack_require__.C";
15432 export let interceptModuleExecution: "__webpack_require__.i";
15433 export let global: "__webpack_require__.g";
15434 export let shareScopeMap: "__webpack_require__.S";
15435 export let initializeSharing: "__webpack_require__.I";
15436 export let currentRemoteGetScope: "__webpack_require__.R";
15437 export let getUpdateManifestFilename: "__webpack_require__.hmrF";
15438 export let hmrDownloadManifest: "__webpack_require__.hmrM";
15439 export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
15440 export let hmrModuleData: "__webpack_require__.hmrD";
15441 export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
15442 export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
15443 export let amdDefine: "__webpack_require__.amdD";
15444 export let amdOptions: "__webpack_require__.amdO";
15445 export let system: "__webpack_require__.System";
15446 export let hasOwnProperty: "__webpack_require__.o";
15447 export let systemContext: "__webpack_require__.y";
15448 export let baseURI: "__webpack_require__.b";
15449 export let relativeUrl: "__webpack_require__.U";
15450 export let asyncModule: "__webpack_require__.a";
15451 }
15452 export const UsageState: Readonly<{
15453 Unused: 0;
15454 OnlyPropertiesUsed: 1;
15455 NoInfo: 2;
15456 Unknown: 3;
15457 Used: 4;
15458 }>;
15459 export namespace cache {
15460 export { MemoryCachePlugin };
15461 }
15462 export namespace config {
15463 export const getNormalizedWebpackOptions: (
15464 config: Configuration
15465 ) => WebpackOptionsNormalized;
15466 export const applyWebpackOptionsDefaults: (
15467 options: WebpackOptionsNormalized,
15468 compilerIndex?: number
15469 ) => ResolvedOptions;
15470 }
15471 export namespace dependencies {
15472 export {
15473 ModuleDependency,
15474 HarmonyImportDependency,
15475 ConstDependency,
15476 NullDependency
15477 };
15478 }
15479 export namespace ids {
15480 export {
15481 ChunkModuleIdRangePlugin,
15482 NaturalModuleIdsPlugin,
15483 OccurrenceModuleIdsPlugin,
15484 NamedModuleIdsPlugin,
15485 DeterministicChunkIdsPlugin,
15486 DeterministicModuleIdsPlugin,
15487 NamedChunkIdsPlugin,
15488 OccurrenceChunkIdsPlugin,
15489 HashedModuleIdsPlugin
15490 };
15491 }
15492 export namespace javascript {
15493 export {
15494 EnableChunkLoadingPlugin,
15495 JavascriptModulesPlugin,
15496 JavascriptParser
15497 };
15498 }
15499 export namespace optimize {
15500 export namespace InnerGraph {
15501 export let bailout: (parserState: ParserState) => void;
15502 export let enable: (parserState: ParserState) => void;
15503 export let isEnabled: (parserState: ParserState) => boolean;
15504 export let addUsage: (
15505 state: ParserState,
15506 symbol: null | TopLevelSymbol,
15507 usage: string | true | TopLevelSymbol
15508 ) => void;
15509 export let addVariableUsage: (
15510 parser: JavascriptParser,
15511 name: string,
15512 usage: string | true | TopLevelSymbol
15513 ) => void;
15514 export let inferDependencyUsage: (state: ParserState) => void;
15515 export let onUsage: (
15516 state: ParserState,
15517 onUsageCallback: (arg0?: boolean | Set<string>) => void
15518 ) => void;
15519 export let setTopLevelSymbol: (
15520 state: ParserState,
15521 symbol?: TopLevelSymbol
15522 ) => void;
15523 export let getTopLevelSymbol: (
15524 state: ParserState
15525 ) => void | TopLevelSymbol;
15526 export let tagTopLevelSymbol: (
15527 parser: JavascriptParser,
15528 name: string
15529 ) => undefined | TopLevelSymbol;
15530 export let isDependencyUsedByExports: (
15531 dependency: Dependency,
15532 usedByExports: boolean | Set<string>,
15533 moduleGraph: ModuleGraph,
15534 runtime: RuntimeSpec
15535 ) => boolean;
15536 export let getDependencyUsedByExportsCondition: (
15537 dependency: Dependency,
15538 usedByExports: undefined | boolean | Set<string>,
15539 moduleGraph: ModuleGraph
15540 ) =>
15541 | null
15542 | false
15543 | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
15544 export { TopLevelSymbol, topLevelSymbolTag };
15545 }
15546 export {
15547 AggressiveMergingPlugin,
15548 AggressiveSplittingPlugin,
15549 LimitChunkCountPlugin,
15550 MinChunkSizePlugin,
15551 ModuleConcatenationPlugin,
15552 RealContentHashPlugin,
15553 RuntimeChunkPlugin,
15554 SideEffectsFlagPlugin,
15555 SplitChunksPlugin
15556 };
15557 }
15558 export namespace runtime {
15559 export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
15560 }
15561 export namespace prefetch {
15562 export { ChunkPrefetchPreloadPlugin };
15563 }
15564 export namespace web {
15565 export {
15566 FetchCompileAsyncWasmPlugin,
15567 FetchCompileWasmPlugin,
15568 JsonpChunkLoadingRuntimeModule,
15569 JsonpTemplatePlugin
15570 };
15571 }
15572 export namespace webworker {
15573 export { WebWorkerTemplatePlugin };
15574 }
15575 export namespace node {
15576 export {
15577 NodeEnvironmentPlugin,
15578 NodeSourcePlugin,
15579 NodeTargetPlugin,
15580 NodeTemplatePlugin,
15581 ReadFileCompileWasmPlugin
15582 };
15583 }
15584 export namespace electron {
15585 export { ElectronTargetPlugin };
15586 }
15587 export namespace wasm {
15588 export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
15589 }
15590 export namespace library {
15591 export { AbstractLibraryPlugin, EnableLibraryPlugin };
15592 }
15593 export namespace container {
15594 export const scope: <T>(
15595 scope: string,
15596 options: ContainerOptionsFormat<T>
15597 ) => Record<string, string | string[] | T>;
15598 export {
15599 ContainerPlugin,
15600 ContainerReferencePlugin,
15601 ModuleFederationPlugin
15602 };
15603 }
15604 export namespace sharing {
15605 export const scope: <T>(
15606 scope: string,
15607 options: ContainerOptionsFormat<T>
15608 ) => Record<string, string | string[] | T>;
15609 export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
15610 }
15611 export namespace debug {
15612 export { ProfilingPlugin };
15613 }
15614 export namespace util {
15615 export const createHash: (algorithm: Algorithm) => Hash;
15616 export namespace comparators {
15617 export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
15618 export let compareModulesByIdentifier: (
15619 a: Module,
15620 b: Module
15621 ) => 0 | 1 | -1;
15622 export let compareModulesById: ParameterizedComparator<
15623 ChunkGraph,
15624 Module
15625 >;
15626 export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
15627 export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
15628 export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
15629 ModuleGraph,
15630 Module
15631 >;
15632 export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
15633 ModuleGraph,
15634 Module
15635 >;
15636 export let compareModulesByIdOrIdentifier: ParameterizedComparator<
15637 ChunkGraph,
15638 Module
15639 >;
15640 export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
15641 export let compareIds: (
15642 a: string | number,
15643 b: string | number
15644 ) => 0 | 1 | -1;
15645 export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
15646 export let compareChunkGroupsByIndex: (
15647 a: ChunkGroup,
15648 b: ChunkGroup
15649 ) => 0 | 1 | -1;
15650 export let concatComparators: <T>(
15651 c1: Comparator<T>,
15652 c2: Comparator<T>,
15653 ...cRest: Comparator<T>[]
15654 ) => Comparator<T>;
15655 export let compareSelect: <T, R>(
15656 getter: Selector<T, R>,
15657 comparator: Comparator<R>
15658 ) => Comparator<T>;
15659 export let compareIterables: <T>(
15660 elementComparator: Comparator<T>
15661 ) => Comparator<Iterable<T>>;
15662 export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
15663 export let compareChunksNatural: (
15664 chunkGraph: ChunkGraph
15665 ) => Comparator<Chunk>;
15666 export let compareLocations: (
15667 a: DependencyLocation,
15668 b: DependencyLocation
15669 ) => 0 | 1 | -1;
15670 }
15671 export namespace runtime {
15672 export let getEntryRuntime: (
15673 compilation: Compilation,
15674 name: string,
15675 options?: EntryOptions
15676 ) => RuntimeSpec;
15677 export let forEachRuntime: (
15678 runtime: RuntimeSpec,
15679 fn: (arg0?: string) => void,
15680 deterministicOrder?: boolean
15681 ) => void;
15682 export let getRuntimeKey: (runtime: RuntimeSpec) => string;
15683 export let keyToRuntime: (key: string) => RuntimeSpec;
15684 export let runtimeToString: (runtime: RuntimeSpec) => string;
15685 export let runtimeConditionToString: (
15686 runtimeCondition: RuntimeCondition
15687 ) => string;
15688 export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
15689 export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
15690 export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
15691 export let mergeRuntimeCondition: (
15692 a: RuntimeCondition,
15693 b: RuntimeCondition,
15694 runtime: RuntimeSpec
15695 ) => RuntimeCondition;
15696 export let mergeRuntimeConditionNonFalse: (
15697 a: undefined | string | true | SortableSet<string>,
15698 b: undefined | string | true | SortableSet<string>,
15699 runtime: RuntimeSpec
15700 ) => undefined | string | true | SortableSet<string>;
15701 export let mergeRuntimeOwned: (
15702 a: RuntimeSpec,
15703 b: RuntimeSpec
15704 ) => RuntimeSpec;
15705 export let intersectRuntime: (
15706 a: RuntimeSpec,
15707 b: RuntimeSpec
15708 ) => RuntimeSpec;
15709 export let subtractRuntime: (
15710 a: RuntimeSpec,
15711 b: RuntimeSpec
15712 ) => RuntimeSpec;
15713 export let subtractRuntimeCondition: (
15714 a: RuntimeCondition,
15715 b: RuntimeCondition,
15716 runtime: RuntimeSpec
15717 ) => RuntimeCondition;
15718 export let filterRuntime: (
15719 runtime: RuntimeSpec,
15720 filter: (arg0: RuntimeSpec) => boolean
15721 ) => undefined | string | boolean | SortableSet<string>;
15722 export { RuntimeSpecMap, RuntimeSpecSet };
15723 }
15724 export namespace serialization {
15725 export const register: (
15726 Constructor: Constructor,
15727 request: string,
15728 name: null | string,
15729 serializer: ObjectSerializer
15730 ) => void;
15731 export const registerLoader: (
15732 regExp: RegExp,
15733 loader: (arg0: string) => boolean
15734 ) => void;
15735 export const registerNotSerializable: (Constructor: Constructor) => void;
15736 export const NOT_SERIALIZABLE: object;
15737 export const buffersSerializer: Serializer;
15738 export let createFileSerializer: (
15739 fs: IntermediateFileSystem,
15740 hashFunction: string | typeof Hash
15741 ) => Serializer;
15742 export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
15743 }
15744 export const cleverMerge: <T, O>(
15745 first?: null | T,
15746 second?: null | O
15747 ) => T | O | (T & O);
15748 export function compileBooleanMatcher(
15749 map: Record<string | number, boolean>
15750 ): boolean | ((arg0: string) => string);
15751 export namespace compileBooleanMatcher {
15752 export let fromLists: (
15753 positiveItems: string[],
15754 negativeItems: string[]
15755 ) => (arg0: string) => string;
15756 export let itemsToRegexp: (itemsArr: string[]) => string;
15757 }
15758 export { LazySet };
15759 }
15760 export namespace sources {
15761 export {
15762 Source,
15763 RawSource,
15764 OriginalSource,
15765 ReplaceSource,
15766 SourceMapSource,
15767 ConcatSource,
15768 PrefixSource,
15769 CachedSource,
15770 SizeOnlySource,
15771 CompatSource
15772 };
15773 }
15774 export namespace experiments {
15775 export namespace schemes {
15776 export { HttpUriPlugin };
15777 }
15778 export namespace ids {
15779 export { SyncModuleIdsPlugin };
15780 }
15781 }
15782 export type WebpackPluginFunction = (
15783 this: Compiler,
15784 compiler: Compiler
15785 ) => void;
15786 export {
15787 AutomaticPrefetchPlugin,
15788 AsyncDependenciesBlock,
15789 BannerPlugin,
15790 Cache,
15791 Chunk,
15792 ChunkGraph,
15793 CleanPlugin,
15794 Compilation,
15795 Compiler,
15796 ConcatenationScope,
15797 ContextExclusionPlugin,
15798 ContextReplacementPlugin,
15799 DefinePlugin,
15800 DelegatedPlugin,
15801 Dependency,
15802 DllPlugin,
15803 DllReferencePlugin,
15804 DynamicEntryPlugin,
15805 EntryOptionPlugin,
15806 EntryPlugin,
15807 EnvironmentPlugin,
15808 EvalDevToolModulePlugin,
15809 EvalSourceMapDevToolPlugin,
15810 ExternalModule,
15811 ExternalsPlugin,
15812 Generator,
15813 HotUpdateChunk,
15814 HotModuleReplacementPlugin,
15815 InitFragment,
15816 IgnorePlugin,
15817 JavascriptModulesPlugin,
15818 LibManifestPlugin,
15819 LibraryTemplatePlugin,
15820 LoaderOptionsPlugin,
15821 LoaderTargetPlugin,
15822 Module,
15823 ModuleGraph,
15824 ModuleGraphConnection,
15825 NoEmitOnErrorsPlugin,
15826 NormalModule,
15827 NormalModuleReplacementPlugin,
15828 MultiCompiler,
15829 Parser,
15830 PlatformPlugin,
15831 PrefetchPlugin,
15832 ProgressPlugin,
15833 ProvidePlugin,
15834 RuntimeModule,
15835 EntryPlugin as SingleEntryPlugin,
15836 SourceMapDevToolPlugin,
15837 Stats,
15838 Template,
15839 WatchIgnorePlugin,
15840 WebpackError,
15841 WebpackOptionsApply,
15842 WebpackOptionsDefaulter,
15843 ValidationError as WebpackOptionsValidationError,
15844 ValidationError,
15845 Entry,
15846 EntryNormalized,
15847 EntryObject,
15848 ExternalItemFunctionData,
15849 ExternalItemObjectKnown,
15850 ExternalItemObjectUnknown,
15851 ExternalItemValue,
15852 Externals,
15853 FileCacheOptions,
15854 LibraryOptions,
15855 MemoryCacheOptions,
15856 ModuleOptions,
15857 ResolveOptions,
15858 RuleSetCondition,
15859 RuleSetConditionAbsolute,
15860 RuleSetRule,
15861 RuleSetUse,
15862 RuleSetUseItem,
15863 StatsOptions,
15864 Configuration,
15865 WebpackOptionsNormalized,
15866 WebpackPluginInstance,
15867 ChunkGroup,
15868 Asset,
15869 AssetInfo,
15870 EntryOptions,
15871 PathData,
15872 AssetEmittedInfo,
15873 MultiCompilerOptions,
15874 MultiStats,
15875 ResolveData,
15876 ParserState,
15877 ResolvePluginInstance,
15878 Resolver,
15879 Watching,
15880 Argument,
15881 Problem,
15882 StatsAsset,
15883 StatsChunk,
15884 StatsChunkGroup,
15885 StatsChunkOrigin,
15886 StatsCompilation,
15887 StatsError,
15888 StatsLogging,
15889 StatsLoggingEntry,
15890 StatsModule,
15891 StatsModuleIssuer,
15892 StatsModuleReason,
15893 StatsModuleTraceDependency,
15894 StatsModuleTraceItem,
15895 StatsProfile,
15896 InputFileSystem,
15897 OutputFileSystem,
15898 LoaderModule,
15899 RawLoaderDefinition,
15900 LoaderDefinition,
15901 LoaderDefinitionFunction,
15902 PitchLoaderDefinitionFunction,
15903 RawLoaderDefinitionFunction,
15904 LoaderContextDeclarationsIndex as LoaderContext
15905 };
15906}
15907declare const topLevelSymbolTag: unique symbol;
15908
15909export = exports;