UNPKG

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