UNPKG

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