UNPKG

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