UNPKG

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