UNPKG

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