UNPKG

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