UNPKG

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