UNPKG

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