UNPKG

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