UNPKG

300 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 ): boolean;
3204 getUsed(runtime: RuntimeSpec): UsageStateType;
3205
3206 /**
3207 * get used name
3208 */
3209 getUsedName(
3210 fallbackName: undefined | string,
3211 runtime: RuntimeSpec
3212 ): string | false;
3213 hasUsedName(): boolean;
3214
3215 /**
3216 * Sets the mangled name of this export
3217 */
3218 setUsedName(name: string): void;
3219 getTerminalBinding(
3220 moduleGraph: ModuleGraph,
3221 resolveTargetFilter?: (arg0: {
3222 module: Module;
3223 export?: string[];
3224 }) => boolean
3225 ): undefined | ExportsInfo | ExportInfo;
3226 isReexport(): undefined | boolean;
3227 findTarget(
3228 moduleGraph: ModuleGraph,
3229 validTargetModuleFilter: (arg0: Module) => boolean
3230 ): undefined | false | { module: Module; export?: string[] };
3231 getTarget(
3232 moduleGraph: ModuleGraph,
3233 resolveTargetFilter?: (arg0: {
3234 module: Module;
3235 export?: string[];
3236 }) => boolean
3237 ): undefined | { module: Module; export?: string[] };
3238
3239 /**
3240 * Move the target forward as long resolveTargetFilter is fulfilled
3241 */
3242 moveTarget(
3243 moduleGraph: ModuleGraph,
3244 resolveTargetFilter: (arg0: {
3245 module: Module;
3246 export?: string[];
3247 }) => boolean,
3248 updateOriginalConnection?: (arg0: {
3249 module: Module;
3250 export?: string[];
3251 }) => ModuleGraphConnection
3252 ): undefined | { module: Module; export?: string[] };
3253 createNestedExportsInfo(): undefined | ExportsInfo;
3254 getNestedExportsInfo(): undefined | ExportsInfo;
3255 hasInfo(baseInfo?: any, runtime?: any): boolean;
3256 updateHash(hash?: any, runtime?: any): void;
3257 getUsedInfo(): string;
3258 getProvidedInfo():
3259 | "no provided info"
3260 | "maybe provided (runtime-defined)"
3261 | "provided"
3262 | "not provided";
3263 getRenameInfo():
3264 | string
3265 | "missing provision and use info prevents renaming"
3266 | "usage prevents renaming (no provision info)"
3267 | "missing provision info prevents renaming"
3268 | "missing usage info prevents renaming"
3269 | "usage prevents renaming"
3270 | "could be renamed"
3271 | "provision prevents renaming (no use info)"
3272 | "usage and provision prevents renaming"
3273 | "provision prevents renaming";
3274}
3275declare interface ExportSpec {
3276 /**
3277 * the name of the export
3278 */
3279 name: string;
3280
3281 /**
3282 * can the export be renamed (defaults to true)
3283 */
3284 canMangle?: boolean;
3285
3286 /**
3287 * is the export a terminal binding that should be checked for export star conflicts
3288 */
3289 terminalBinding?: boolean;
3290
3291 /**
3292 * nested exports
3293 */
3294 exports?: (string | ExportSpec)[];
3295
3296 /**
3297 * when reexported: from which module
3298 */
3299 from?: ModuleGraphConnection;
3300
3301 /**
3302 * when reexported: from which export
3303 */
3304 export?: null | string[];
3305
3306 /**
3307 * export is not visible, because another export blends over it
3308 */
3309 hidden?: boolean;
3310}
3311type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
3312declare abstract class ExportsInfo {
3313 readonly ownedExports: Iterable<ExportInfo>;
3314 readonly orderedOwnedExports: Iterable<ExportInfo>;
3315 readonly exports: Iterable<ExportInfo>;
3316 readonly orderedExports: Iterable<ExportInfo>;
3317 readonly otherExportsInfo: ExportInfo;
3318 setRedirectNamedTo(exportsInfo?: any): boolean;
3319 setHasProvideInfo(): void;
3320 setHasUseInfo(): void;
3321 getOwnExportInfo(name: string): ExportInfo;
3322 getExportInfo(name: string): ExportInfo;
3323 getReadOnlyExportInfo(name: string): ExportInfo;
3324 getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
3325 getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
3326 setUnknownExportsProvided(
3327 canMangle?: boolean,
3328 excludeExports?: Set<string>,
3329 targetKey?: any,
3330 targetModule?: ModuleGraphConnection
3331 ): boolean;
3332 setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
3333 setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
3334 setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
3335 setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
3336 isUsed(runtime: RuntimeSpec): boolean;
3337 isModuleUsed(runtime: RuntimeSpec): boolean;
3338 getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
3339 getProvidedExports(): null | true | string[];
3340 getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
3341 isExportProvided(name: string | string[]): undefined | null | boolean;
3342 getUsageKey(runtime: RuntimeSpec): string;
3343 isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
3344 getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
3345 getUsedName(
3346 name: string | string[],
3347 runtime: RuntimeSpec
3348 ): string | false | string[];
3349 updateHash(hash: Hash, runtime: RuntimeSpec): void;
3350 getRestoreProvidedData(): any;
3351 restoreProvided(__0: {
3352 otherProvided: any;
3353 otherCanMangleProvide: any;
3354 otherTerminalBinding: any;
3355 exports: any;
3356 }): void;
3357}
3358declare interface ExportsSpec {
3359 /**
3360 * exported names, true for unknown exports or null for no exports
3361 */
3362 exports: null | true | (string | ExportSpec)[];
3363
3364 /**
3365 * when exports = true, list of unaffected exports
3366 */
3367 excludeExports?: Set<string>;
3368
3369 /**
3370 * list of maybe prior exposed, but now hidden exports
3371 */
3372 hideExports?: Set<string>;
3373
3374 /**
3375 * when reexported: from which module
3376 */
3377 from?: ModuleGraphConnection;
3378
3379 /**
3380 * can the export be renamed (defaults to true)
3381 */
3382 canMangle?: boolean;
3383
3384 /**
3385 * are the exports terminal bindings that should be checked for export star conflicts
3386 */
3387 terminalBinding?: boolean;
3388
3389 /**
3390 * module on which the result depends on
3391 */
3392 dependencies?: Module[];
3393}
3394type Exposes = (string | ExposesObject)[] | ExposesObject;
3395
3396/**
3397 * Advanced configuration for modules that should be exposed by this container.
3398 */
3399declare interface ExposesConfig {
3400 /**
3401 * Request to a module that should be exposed by this container.
3402 */
3403 import: string | string[];
3404
3405 /**
3406 * Custom chunk name for the exposed module.
3407 */
3408 name?: string;
3409}
3410
3411/**
3412 * Modules that should be exposed by this container. Property names are used as public paths.
3413 */
3414declare interface ExposesObject {
3415 [index: string]: string | ExposesConfig | string[];
3416}
3417type Expression =
3418 | UnaryExpression
3419 | ThisExpression
3420 | ArrayExpression
3421 | ObjectExpression
3422 | FunctionExpression
3423 | ArrowFunctionExpression
3424 | YieldExpression
3425 | SimpleLiteral
3426 | RegExpLiteral
3427 | UpdateExpression
3428 | BinaryExpression
3429 | AssignmentExpression
3430 | LogicalExpression
3431 | MemberExpression
3432 | ConditionalExpression
3433 | SimpleCallExpression
3434 | NewExpression
3435 | SequenceExpression
3436 | TemplateLiteral
3437 | TaggedTemplateExpression
3438 | ClassExpression
3439 | MetaProperty
3440 | Identifier
3441 | AwaitExpression
3442 | ImportExpression
3443 | ChainExpression;
3444declare interface ExpressionExpressionInfo {
3445 type: "expression";
3446 rootInfo: string | VariableInfo;
3447 name: string;
3448 getMembers: () => string[];
3449}
3450type ExternalItem =
3451 | string
3452 | RegExp
3453 | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
3454 | ((
3455 data: ExternalItemFunctionData,
3456 callback: (
3457 err?: Error,
3458 result?: string | boolean | string[] | { [index: string]: any }
3459 ) => void
3460 ) => void)
3461 | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
3462
3463/**
3464 * Data object passed as argument when a function is set for 'externals'.
3465 */
3466declare interface ExternalItemFunctionData {
3467 /**
3468 * The directory in which the request is placed.
3469 */
3470 context?: string;
3471
3472 /**
3473 * Contextual information.
3474 */
3475 contextInfo?: ModuleFactoryCreateDataContextInfo;
3476
3477 /**
3478 * Get a resolve function with the current resolver options.
3479 */
3480 getResolve?: (
3481 options?: ResolveOptionsWebpackOptions
3482 ) =>
3483 | ((
3484 context: string,
3485 request: string,
3486 callback: (err?: Error, result?: string) => void
3487 ) => void)
3488 | ((context: string, request: string) => Promise<string>);
3489
3490 /**
3491 * The request as written by the user in the require/import expression/statement.
3492 */
3493 request?: string;
3494}
3495
3496/**
3497 * If an dependency matches exactly a property of the object, the property value is used as dependency.
3498 */
3499declare interface ExternalItemObjectKnown {
3500 /**
3501 * Specify externals depending on the layer.
3502 */
3503 byLayer?:
3504 | { [index: string]: ExternalItem }
3505 | ((layer: null | string) => ExternalItem);
3506}
3507
3508/**
3509 * If an dependency matches exactly a property of the object, the property value is used as dependency.
3510 */
3511declare interface ExternalItemObjectUnknown {
3512 [index: string]: ExternalItemValue;
3513}
3514type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
3515declare class ExternalModule extends Module {
3516 constructor(request?: any, type?: any, userRequest?: any);
3517 request: string | string[] | Record<string, string | string[]>;
3518 externalType: string;
3519 userRequest: string;
3520 getSourceData(
3521 runtimeTemplate?: any,
3522 moduleGraph?: any,
3523 chunkGraph?: any
3524 ): SourceData;
3525}
3526declare interface ExternalModuleInfo {
3527 index: number;
3528 module: Module;
3529}
3530type Externals =
3531 | string
3532 | RegExp
3533 | ExternalItem[]
3534 | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
3535 | ((
3536 data: ExternalItemFunctionData,
3537 callback: (
3538 err?: Error,
3539 result?: string | boolean | string[] | { [index: string]: any }
3540 ) => void
3541 ) => void)
3542 | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
3543declare class ExternalsPlugin {
3544 constructor(type: undefined | string, externals: Externals);
3545 type?: string;
3546 externals: Externals;
3547
3548 /**
3549 * Apply the plugin
3550 */
3551 apply(compiler: Compiler): void;
3552}
3553
3554/**
3555 * Enable presets of externals for specific targets.
3556 */
3557declare interface ExternalsPresets {
3558 /**
3559 * 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.
3560 */
3561 electron?: boolean;
3562
3563 /**
3564 * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
3565 */
3566 electronMain?: boolean;
3567
3568 /**
3569 * 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.
3570 */
3571 electronPreload?: boolean;
3572
3573 /**
3574 * 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.
3575 */
3576 electronRenderer?: boolean;
3577
3578 /**
3579 * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
3580 */
3581 node?: boolean;
3582
3583 /**
3584 * Treat NW.js legacy nw.gui module as external and load it via require() when used.
3585 */
3586 nwjs?: boolean;
3587
3588 /**
3589 * 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).
3590 */
3591 web?: boolean;
3592
3593 /**
3594 * 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).
3595 */
3596 webAsync?: boolean;
3597}
3598type ExternalsType =
3599 | "var"
3600 | "module"
3601 | "assign"
3602 | "this"
3603 | "window"
3604 | "self"
3605 | "global"
3606 | "commonjs"
3607 | "commonjs2"
3608 | "commonjs-module"
3609 | "amd"
3610 | "amd-require"
3611 | "umd"
3612 | "umd2"
3613 | "jsonp"
3614 | "system"
3615 | "promise"
3616 | "import"
3617 | "script";
3618declare interface FactorizeModuleOptions {
3619 currentProfile: ModuleProfile;
3620 factory: ModuleFactory;
3621 dependencies: Dependency[];
3622 originModule: null | Module;
3623 contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
3624 context?: string;
3625}
3626type FakeHook<T> = T & FakeHookMarker;
3627declare interface FakeHookMarker {}
3628declare interface FallbackCacheGroup {
3629 minSize: SplitChunksSizes;
3630 maxAsyncSize: SplitChunksSizes;
3631 maxInitialSize: SplitChunksSizes;
3632 automaticNameDelimiter: string;
3633}
3634declare class FetchCompileAsyncWasmPlugin {
3635 constructor();
3636
3637 /**
3638 * Apply the plugin
3639 */
3640 apply(compiler: Compiler): void;
3641}
3642declare class FetchCompileWasmPlugin {
3643 constructor(options?: any);
3644 options: any;
3645
3646 /**
3647 * Apply the plugin
3648 */
3649 apply(compiler: Compiler): void;
3650}
3651
3652/**
3653 * Options object for persistent file-based caching.
3654 */
3655declare interface FileCacheOptions {
3656 /**
3657 * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
3658 */
3659 buildDependencies?: { [index: string]: string[] };
3660
3661 /**
3662 * Base directory for the cache (defaults to node_modules/.cache/webpack).
3663 */
3664 cacheDirectory?: string;
3665
3666 /**
3667 * Locations for the cache (defaults to cacheDirectory / name).
3668 */
3669 cacheLocation?: string;
3670
3671 /**
3672 * Algorithm used for generation the hash (see node.js crypto package).
3673 */
3674 hashAlgorithm?: string;
3675
3676 /**
3677 * Time in ms after which idle period the cache storing should happen (only for store: 'pack' or 'idle').
3678 */
3679 idleTimeout?: number;
3680
3681 /**
3682 * Time in ms after which idle period the initial cache storing should happen (only for store: 'pack' or 'idle').
3683 */
3684 idleTimeoutForInitialStore?: number;
3685
3686 /**
3687 * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
3688 */
3689 immutablePaths?: string[];
3690
3691 /**
3692 * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
3693 */
3694 managedPaths?: string[];
3695
3696 /**
3697 * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
3698 */
3699 maxAge?: number;
3700
3701 /**
3702 * 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.
3703 */
3704 maxMemoryGenerations?: number;
3705
3706 /**
3707 * Name for the cache. Different names will lead to different coexisting caches.
3708 */
3709 name?: string;
3710
3711 /**
3712 * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
3713 */
3714 store?: "pack";
3715
3716 /**
3717 * Filesystem caching.
3718 */
3719 type: "filesystem";
3720
3721 /**
3722 * 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.
3723 */
3724 version?: string;
3725}
3726declare interface FileSystem {
3727 readFile: {
3728 (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
3729 (
3730 arg0: string,
3731 arg1: object,
3732 arg2: FileSystemCallback<string | Buffer>
3733 ): void;
3734 };
3735 readdir: {
3736 (
3737 arg0: string,
3738 arg1: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
3739 ): void;
3740 (
3741 arg0: string,
3742 arg1: object,
3743 arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
3744 ): void;
3745 };
3746 readJson?: {
3747 (arg0: string, arg1: FileSystemCallback<object>): void;
3748 (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
3749 };
3750 readlink: {
3751 (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
3752 (
3753 arg0: string,
3754 arg1: object,
3755 arg2: FileSystemCallback<string | Buffer>
3756 ): void;
3757 };
3758 lstat?: {
3759 (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
3760 (
3761 arg0: string,
3762 arg1: object,
3763 arg2: FileSystemCallback<string | Buffer>
3764 ): void;
3765 };
3766 stat: {
3767 (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
3768 (
3769 arg0: string,
3770 arg1: object,
3771 arg2: FileSystemCallback<string | Buffer>
3772 ): void;
3773 };
3774}
3775declare interface FileSystemCallback<T> {
3776 (err?: null | (PossibleFileSystemError & Error), result?: T): any;
3777}
3778declare interface FileSystemDirent {
3779 name: string | Buffer;
3780 isDirectory: () => boolean;
3781 isFile: () => boolean;
3782}
3783declare abstract class FileSystemInfo {
3784 fs: InputFileSystem;
3785 logger?: WebpackLogger;
3786 fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
3787 fileHashQueue: AsyncQueue<string, string, null | string>;
3788 contextTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
3789 contextHashQueue: AsyncQueue<string, string, null | string>;
3790 managedItemQueue: AsyncQueue<string, string, null | string>;
3791 managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
3792 managedPaths: string[];
3793 managedPathsWithSlash: string[];
3794 immutablePaths: string[];
3795 immutablePathsWithSlash: string[];
3796 logStatistics(): void;
3797 clear(): void;
3798 addFileTimestamps(
3799 map: Map<string, null | FileSystemInfoEntry | "ignore">
3800 ): void;
3801 addContextTimestamps(
3802 map: Map<string, null | FileSystemInfoEntry | "ignore">
3803 ): void;
3804 getFileTimestamp(
3805 path: string,
3806 callback: (
3807 arg0?: WebpackError,
3808 arg1?: null | FileSystemInfoEntry | "ignore"
3809 ) => void
3810 ): void;
3811 getContextTimestamp(
3812 path: string,
3813 callback: (
3814 arg0?: WebpackError,
3815 arg1?: null | FileSystemInfoEntry | "ignore"
3816 ) => void
3817 ): void;
3818 getFileHash(
3819 path: string,
3820 callback: (arg0?: WebpackError, arg1?: string) => void
3821 ): void;
3822 getContextHash(
3823 path: string,
3824 callback: (arg0?: WebpackError, arg1?: string) => void
3825 ): void;
3826 resolveBuildDependencies(
3827 context: string,
3828 deps: Iterable<string>,
3829 callback: (arg0?: Error, arg1?: ResolveBuildDependenciesResult) => void
3830 ): void;
3831 checkResolveResultsValid(
3832 resolveResults: Map<string, string>,
3833 callback: (arg0?: Error, arg1?: boolean) => void
3834 ): void;
3835 createSnapshot(
3836 startTime: number,
3837 files: Iterable<string>,
3838 directories: Iterable<string>,
3839 missing: Iterable<string>,
3840 options: {
3841 /**
3842 * Use hashes of the content of the files/directories to determine invalidation.
3843 */
3844 hash?: boolean;
3845 /**
3846 * Use timestamps of the files/directories to determine invalidation.
3847 */
3848 timestamp?: boolean;
3849 },
3850 callback: (arg0?: WebpackError, arg1?: Snapshot) => void
3851 ): void;
3852 mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
3853 checkSnapshotValid(
3854 snapshot: Snapshot,
3855 callback: (arg0?: WebpackError, arg1?: boolean) => void
3856 ): void;
3857 getDeprecatedFileTimestamps(): Map<any, any>;
3858 getDeprecatedContextTimestamps(): Map<any, any>;
3859}
3860declare interface FileSystemInfoEntry {
3861 safeTime: number;
3862 timestamp?: number;
3863 timestampHash?: string;
3864}
3865declare interface FileSystemStats {
3866 isDirectory: () => boolean;
3867 isFile: () => boolean;
3868}
3869type FilterItemTypes = string | RegExp | ((value: string) => boolean);
3870declare interface GenerateContext {
3871 /**
3872 * mapping from dependencies to templates
3873 */
3874 dependencyTemplates: DependencyTemplates;
3875
3876 /**
3877 * the runtime template
3878 */
3879 runtimeTemplate: RuntimeTemplate;
3880
3881 /**
3882 * the module graph
3883 */
3884 moduleGraph: ModuleGraph;
3885
3886 /**
3887 * the chunk graph
3888 */
3889 chunkGraph: ChunkGraph;
3890
3891 /**
3892 * the requirements for runtime
3893 */
3894 runtimeRequirements: Set<string>;
3895
3896 /**
3897 * the runtime
3898 */
3899 runtime: RuntimeSpec;
3900
3901 /**
3902 * when in concatenated module, information about other concatenated modules
3903 */
3904 concatenationScope?: ConcatenationScope;
3905
3906 /**
3907 * which kind of code should be generated
3908 */
3909 type: string;
3910
3911 /**
3912 * get access to the code generation data
3913 */
3914 getData?: () => Map<string, any>;
3915}
3916declare class Generator {
3917 constructor();
3918 getTypes(module: NormalModule): Set<string>;
3919 getSize(module: NormalModule, type?: string): number;
3920 generate(module: NormalModule, __1: GenerateContext): Source;
3921 getConcatenationBailoutReason(
3922 module: NormalModule,
3923 context: ConcatenationBailoutReasonContext
3924 ): undefined | string;
3925 updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
3926 static byType(map?: any): ByTypeGenerator;
3927}
3928type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
3929 GeneratorOptionsByModuleTypeUnknown;
3930
3931/**
3932 * Specify options for each generator.
3933 */
3934declare interface GeneratorOptionsByModuleTypeKnown {
3935 /**
3936 * Generator options for asset modules.
3937 */
3938 asset?: AssetGeneratorOptions;
3939
3940 /**
3941 * Generator options for asset/inline modules.
3942 */
3943 "asset/inline"?: AssetInlineGeneratorOptions;
3944
3945 /**
3946 * Generator options for asset/resource modules.
3947 */
3948 "asset/resource"?: AssetResourceGeneratorOptions;
3949
3950 /**
3951 * No generator options are supported for this module type.
3952 */
3953 javascript?: EmptyGeneratorOptions;
3954
3955 /**
3956 * No generator options are supported for this module type.
3957 */
3958 "javascript/auto"?: EmptyGeneratorOptions;
3959
3960 /**
3961 * No generator options are supported for this module type.
3962 */
3963 "javascript/dynamic"?: EmptyGeneratorOptions;
3964
3965 /**
3966 * No generator options are supported for this module type.
3967 */
3968 "javascript/esm"?: EmptyGeneratorOptions;
3969}
3970
3971/**
3972 * Specify options for each generator.
3973 */
3974declare interface GeneratorOptionsByModuleTypeUnknown {
3975 [index: string]: { [index: string]: any };
3976}
3977declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
3978 constructor(
3979 contentType: string,
3980 name: string,
3981 global: string,
3982 getFilenameForChunk: (
3983 arg0: Chunk
3984 ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
3985 allChunks: boolean
3986 );
3987 contentType: string;
3988 global: string;
3989 getFilenameForChunk: (
3990 arg0: Chunk
3991 ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
3992 allChunks: boolean;
3993
3994 /**
3995 * Runtime modules without any dependencies to other runtime modules
3996 */
3997 static STAGE_NORMAL: number;
3998
3999 /**
4000 * Runtime modules with simple dependencies on other runtime modules
4001 */
4002 static STAGE_BASIC: number;
4003
4004 /**
4005 * Runtime modules which attach to handlers of other runtime modules
4006 */
4007 static STAGE_ATTACH: number;
4008
4009 /**
4010 * Runtime modules which trigger actions on bootstrap
4011 */
4012 static STAGE_TRIGGER: number;
4013}
4014declare interface GroupConfig {
4015 getKeys: (arg0?: any) => string[];
4016 createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
4017 getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
4018}
4019declare interface GroupOptions {
4020 groupChildren?: boolean;
4021 force?: boolean;
4022 targetGroupCount?: number;
4023}
4024declare interface HMRJavascriptParserHooks {
4025 hotAcceptCallback: SyncBailHook<[any, string[]], void>;
4026 hotAcceptWithoutCallback: SyncBailHook<[any, string[]], void>;
4027}
4028declare interface HandleModuleCreationOptions {
4029 factory: ModuleFactory;
4030 dependencies: Dependency[];
4031 originModule: null | Module;
4032 contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
4033 context?: string;
4034
4035 /**
4036 * recurse into dependencies of the created module
4037 */
4038 recursive?: boolean;
4039}
4040declare class Hash {
4041 constructor();
4042
4043 /**
4044 * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
4045 */
4046 update(data: string | Buffer, inputEncoding?: string): Hash;
4047
4048 /**
4049 * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
4050 */
4051 digest(encoding?: string): string | Buffer;
4052}
4053declare interface HashableObject {
4054 updateHash: (arg0: Hash) => void;
4055}
4056declare class HashedModuleIdsPlugin {
4057 constructor(options?: HashedModuleIdsPluginOptions);
4058 options: HashedModuleIdsPluginOptions;
4059 apply(compiler?: any): void;
4060}
4061declare interface HashedModuleIdsPluginOptions {
4062 /**
4063 * The context directory for creating names.
4064 */
4065 context?: string;
4066
4067 /**
4068 * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
4069 */
4070 hashDigest?: "hex" | "latin1" | "base64";
4071
4072 /**
4073 * The prefix length of the hash digest to use, defaults to 4.
4074 */
4075 hashDigestLength?: number;
4076
4077 /**
4078 * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
4079 */
4080 hashFunction?: string;
4081}
4082declare abstract class HelperRuntimeModule extends RuntimeModule {}
4083declare class HotModuleReplacementPlugin {
4084 constructor(options?: any);
4085 options: any;
4086
4087 /**
4088 * Apply the plugin
4089 */
4090 apply(compiler: Compiler): void;
4091 static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
4092}
4093declare class HotUpdateChunk extends Chunk {
4094 constructor();
4095}
4096declare class HttpUriPlugin {
4097 constructor();
4098
4099 /**
4100 * Apply the plugin
4101 */
4102 apply(compiler: Compiler): void;
4103}
4104declare class HttpsUriPlugin {
4105 constructor();
4106
4107 /**
4108 * Apply the plugin
4109 */
4110 apply(compiler: Compiler): void;
4111}
4112declare interface IDirent {
4113 isFile: () => boolean;
4114 isDirectory: () => boolean;
4115 isBlockDevice: () => boolean;
4116 isCharacterDevice: () => boolean;
4117 isSymbolicLink: () => boolean;
4118 isFIFO: () => boolean;
4119 isSocket: () => boolean;
4120 name: string | Buffer;
4121}
4122declare interface IStats {
4123 isFile: () => boolean;
4124 isDirectory: () => boolean;
4125 isBlockDevice: () => boolean;
4126 isCharacterDevice: () => boolean;
4127 isSymbolicLink: () => boolean;
4128 isFIFO: () => boolean;
4129 isSocket: () => boolean;
4130 dev: number | bigint;
4131 ino: number | bigint;
4132 mode: number | bigint;
4133 nlink: number | bigint;
4134 uid: number | bigint;
4135 gid: number | bigint;
4136 rdev: number | bigint;
4137 size: number | bigint;
4138 blksize: number | bigint;
4139 blocks: number | bigint;
4140 atimeMs: number | bigint;
4141 mtimeMs: number | bigint;
4142 ctimeMs: number | bigint;
4143 birthtimeMs: number | bigint;
4144 atime: Date;
4145 mtime: Date;
4146 ctime: Date;
4147 birthtime: Date;
4148}
4149declare class IgnorePlugin {
4150 constructor(options: IgnorePluginOptions);
4151 options: IgnorePluginOptions;
4152
4153 /**
4154 * Note that if "contextRegExp" is given, both the "resourceRegExp"
4155 * and "contextRegExp" have to match.
4156 */
4157 checkIgnore(resolveData: ResolveData): undefined | false;
4158
4159 /**
4160 * Apply the plugin
4161 */
4162 apply(compiler: Compiler): void;
4163}
4164type IgnorePluginOptions =
4165 | {
4166 /**
4167 * A RegExp to test the context (directory) against.
4168 */
4169 contextRegExp?: RegExp;
4170 /**
4171 * A RegExp to test the request against.
4172 */
4173 resourceRegExp?: RegExp;
4174 }
4175 | {
4176 /**
4177 * A filter function for resource and context.
4178 */
4179 checkResource?: (resource: string, context: string) => boolean;
4180 };
4181type ImportSource = undefined | null | string | SimpleLiteral | RegExpLiteral;
4182
4183/**
4184 * Options for infrastructure level logging.
4185 */
4186declare interface InfrastructureLogging {
4187 /**
4188 * Enable debug logging for specific loggers.
4189 */
4190 debug?:
4191 | string
4192 | boolean
4193 | RegExp
4194 | FilterItemTypes[]
4195 | ((value: string) => boolean);
4196
4197 /**
4198 * Log level.
4199 */
4200 level?: "none" | "verbose" | "error" | "warn" | "info" | "log";
4201}
4202declare abstract class InitFragment {
4203 content: string | Source;
4204 stage: number;
4205 position: number;
4206 key?: string;
4207 endContent?: string | Source;
4208 getContent(generateContext: GenerateContext): string | Source;
4209 getEndContent(generateContext: GenerateContext): undefined | string | Source;
4210 merge: any;
4211}
4212declare interface InputFileSystem {
4213 readFile: (
4214 arg0: string,
4215 arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
4216 ) => void;
4217 readJson?: (
4218 arg0: string,
4219 arg1: (arg0?: Error | NodeJS.ErrnoException, arg1?: any) => void
4220 ) => void;
4221 readlink: (
4222 arg0: string,
4223 arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
4224 ) => void;
4225 readdir: (
4226 arg0: string,
4227 arg1: (
4228 arg0?: NodeJS.ErrnoException,
4229 arg1?: (string | Buffer)[] | IDirent[]
4230 ) => void
4231 ) => void;
4232 stat: (
4233 arg0: string,
4234 arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
4235 ) => void;
4236 realpath?: (
4237 arg0: string,
4238 arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
4239 ) => void;
4240 purge?: (arg0?: string) => void;
4241 join?: (arg0: string, arg1: string) => string;
4242 relative?: (arg0: string, arg1: string) => string;
4243 dirname?: (arg0: string) => string;
4244}
4245type IntermediateFileSystem = InputFileSystem &
4246 OutputFileSystem &
4247 IntermediateFileSystemExtras;
4248declare interface IntermediateFileSystemExtras {
4249 mkdirSync: (arg0: string) => void;
4250 createWriteStream: (arg0: string) => NodeJS.WritableStream;
4251 open: (
4252 arg0: string,
4253 arg1: string,
4254 arg2: (arg0?: NodeJS.ErrnoException, arg1?: number) => void
4255 ) => void;
4256 read: (
4257 arg0: number,
4258 arg1: Buffer,
4259 arg2: number,
4260 arg3: number,
4261 arg4: number,
4262 arg5: (arg0?: NodeJS.ErrnoException, arg1?: number) => void
4263 ) => void;
4264 close: (arg0: number, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
4265 rename: (
4266 arg0: string,
4267 arg1: string,
4268 arg2: (arg0?: NodeJS.ErrnoException) => void
4269 ) => void;
4270}
4271type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
4272declare abstract class ItemCacheFacade {
4273 get<T>(callback: CallbackCache<T>): void;
4274 getPromise<T>(): Promise<T>;
4275 store<T>(data: T, callback: CallbackCache<void>): void;
4276 storePromise<T>(data: T): Promise<void>;
4277 provide<T>(
4278 computer: (arg0: CallbackNormalErrorCache<T>) => void,
4279 callback: CallbackNormalErrorCache<T>
4280 ): void;
4281 providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
4282}
4283declare class JavascriptModulesPlugin {
4284 constructor(options?: object);
4285 options: object;
4286
4287 /**
4288 * Apply the plugin
4289 */
4290 apply(compiler: Compiler): void;
4291 renderModule(
4292 module: Module,
4293 renderContext: RenderContextObject,
4294 hooks: CompilationHooksJavascriptModulesPlugin,
4295 factory: boolean | "strict"
4296 ): Source;
4297 renderChunk(
4298 renderContext: RenderContextObject,
4299 hooks: CompilationHooksJavascriptModulesPlugin
4300 ): Source;
4301 renderMain(
4302 renderContext: MainRenderContext,
4303 hooks: CompilationHooksJavascriptModulesPlugin,
4304 compilation: Compilation
4305 ): Source;
4306 updateHashWithBootstrap(
4307 hash: Hash,
4308 renderContext: RenderBootstrapContext,
4309 hooks: CompilationHooksJavascriptModulesPlugin
4310 ): void;
4311 renderBootstrap(
4312 renderContext: RenderBootstrapContext,
4313 hooks: CompilationHooksJavascriptModulesPlugin
4314 ): {
4315 header: string[];
4316 beforeStartup: string[];
4317 startup: string[];
4318 afterStartup: string[];
4319 allowInlineStartup: boolean;
4320 };
4321 renderRequire(
4322 renderContext: RenderBootstrapContext,
4323 hooks: CompilationHooksJavascriptModulesPlugin
4324 ): string;
4325 static getCompilationHooks(
4326 compilation: Compilation
4327 ): CompilationHooksJavascriptModulesPlugin;
4328 static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any;
4329 static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
4330}
4331declare class JavascriptParser extends Parser {
4332 constructor(sourceType?: "module" | "script" | "auto");
4333 hooks: Readonly<{
4334 evaluateTypeof: HookMap<
4335 SyncBailHook<
4336 [UnaryExpression],
4337 undefined | null | BasicEvaluatedExpression
4338 >
4339 >;
4340 evaluate: HookMap<
4341 SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
4342 >;
4343 evaluateIdentifier: HookMap<
4344 SyncBailHook<
4345 [ThisExpression | MemberExpression | MetaProperty | Identifier],
4346 undefined | null | BasicEvaluatedExpression
4347 >
4348 >;
4349 evaluateDefinedIdentifier: HookMap<
4350 SyncBailHook<
4351 [ThisExpression | MemberExpression | Identifier],
4352 undefined | null | BasicEvaluatedExpression
4353 >
4354 >;
4355 evaluateCallExpressionMember: HookMap<
4356 SyncBailHook<
4357 [CallExpression, undefined | BasicEvaluatedExpression],
4358 undefined | null | BasicEvaluatedExpression
4359 >
4360 >;
4361 isPure: HookMap<
4362 SyncBailHook<
4363 [
4364 (
4365 | UnaryExpression
4366 | ThisExpression
4367 | ArrayExpression
4368 | ObjectExpression
4369 | FunctionExpression
4370 | ArrowFunctionExpression
4371 | YieldExpression
4372 | SimpleLiteral
4373 | RegExpLiteral
4374 | UpdateExpression
4375 | BinaryExpression
4376 | AssignmentExpression
4377 | LogicalExpression
4378 | MemberExpression
4379 | ConditionalExpression
4380 | SimpleCallExpression
4381 | NewExpression
4382 | SequenceExpression
4383 | TemplateLiteral
4384 | TaggedTemplateExpression
4385 | ClassExpression
4386 | MetaProperty
4387 | Identifier
4388 | AwaitExpression
4389 | ImportExpression
4390 | ChainExpression
4391 | FunctionDeclaration
4392 | VariableDeclaration
4393 | ClassDeclaration
4394 ),
4395 number
4396 ],
4397 boolean | void
4398 >
4399 >;
4400 preStatement: SyncBailHook<
4401 [
4402 | FunctionDeclaration
4403 | VariableDeclaration
4404 | ClassDeclaration
4405 | ExpressionStatement
4406 | BlockStatement
4407 | EmptyStatement
4408 | DebuggerStatement
4409 | WithStatement
4410 | ReturnStatement
4411 | LabeledStatement
4412 | BreakStatement
4413 | ContinueStatement
4414 | IfStatement
4415 | SwitchStatement
4416 | ThrowStatement
4417 | TryStatement
4418 | WhileStatement
4419 | DoWhileStatement
4420 | ForStatement
4421 | ForInStatement
4422 | ForOfStatement
4423 | ImportDeclaration
4424 | ExportNamedDeclaration
4425 | ExportDefaultDeclaration
4426 | ExportAllDeclaration
4427 ],
4428 boolean | void
4429 >;
4430 blockPreStatement: SyncBailHook<
4431 [
4432 | FunctionDeclaration
4433 | VariableDeclaration
4434 | ClassDeclaration
4435 | ExpressionStatement
4436 | BlockStatement
4437 | EmptyStatement
4438 | DebuggerStatement
4439 | WithStatement
4440 | ReturnStatement
4441 | LabeledStatement
4442 | BreakStatement
4443 | ContinueStatement
4444 | IfStatement
4445 | SwitchStatement
4446 | ThrowStatement
4447 | TryStatement
4448 | WhileStatement
4449 | DoWhileStatement
4450 | ForStatement
4451 | ForInStatement
4452 | ForOfStatement
4453 | ImportDeclaration
4454 | ExportNamedDeclaration
4455 | ExportDefaultDeclaration
4456 | ExportAllDeclaration
4457 ],
4458 boolean | void
4459 >;
4460 statement: SyncBailHook<
4461 [
4462 | FunctionDeclaration
4463 | VariableDeclaration
4464 | ClassDeclaration
4465 | ExpressionStatement
4466 | BlockStatement
4467 | EmptyStatement
4468 | DebuggerStatement
4469 | WithStatement
4470 | ReturnStatement
4471 | LabeledStatement
4472 | BreakStatement
4473 | ContinueStatement
4474 | IfStatement
4475 | SwitchStatement
4476 | ThrowStatement
4477 | TryStatement
4478 | WhileStatement
4479 | DoWhileStatement
4480 | ForStatement
4481 | ForInStatement
4482 | ForOfStatement
4483 | ImportDeclaration
4484 | ExportNamedDeclaration
4485 | ExportDefaultDeclaration
4486 | ExportAllDeclaration
4487 ],
4488 boolean | void
4489 >;
4490 statementIf: SyncBailHook<[IfStatement], boolean | void>;
4491 classExtendsExpression: SyncBailHook<
4492 [Expression, ClassExpression | ClassDeclaration],
4493 boolean | void
4494 >;
4495 classBodyElement: SyncBailHook<
4496 [MethodDefinition, ClassExpression | ClassDeclaration],
4497 boolean | void
4498 >;
4499 label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
4500 import: SyncBailHook<[Statement, ImportSource], boolean | void>;
4501 importSpecifier: SyncBailHook<
4502 [Statement, ImportSource, string, string],
4503 boolean | void
4504 >;
4505 export: SyncBailHook<[Statement], boolean | void>;
4506 exportImport: SyncBailHook<[Statement, ImportSource], boolean | void>;
4507 exportDeclaration: SyncBailHook<[Statement, Declaration], boolean | void>;
4508 exportExpression: SyncBailHook<[Statement, Declaration], boolean | void>;
4509 exportSpecifier: SyncBailHook<
4510 [Statement, string, string, undefined | number],
4511 boolean | void
4512 >;
4513 exportImportSpecifier: SyncBailHook<
4514 [Statement, ImportSource, string, string, undefined | number],
4515 boolean | void
4516 >;
4517 preDeclarator: SyncBailHook<
4518 [VariableDeclarator, Statement],
4519 boolean | void
4520 >;
4521 declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
4522 varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
4523 varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
4524 varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
4525 varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
4526 pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
4527 canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
4528 rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
4529 assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
4530 assignMemberChain: HookMap<
4531 SyncBailHook<[AssignmentExpression, string[]], boolean | void>
4532 >;
4533 typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
4534 importCall: SyncBailHook<[Expression], boolean | void>;
4535 topLevelAwait: SyncBailHook<[Expression], boolean | void>;
4536 call: HookMap<SyncBailHook<[Expression], boolean | void>>;
4537 callMemberChain: HookMap<
4538 SyncBailHook<[CallExpression, string[]], boolean | void>
4539 >;
4540 memberChainOfCallMemberChain: HookMap<
4541 SyncBailHook<
4542 [Expression, string[], CallExpression, string[]],
4543 boolean | void
4544 >
4545 >;
4546 callMemberChainOfCallMemberChain: HookMap<
4547 SyncBailHook<
4548 [Expression, string[], CallExpression, string[]],
4549 boolean | void
4550 >
4551 >;
4552 optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
4553 new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
4554 expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
4555 expressionMemberChain: HookMap<
4556 SyncBailHook<[Expression, string[]], boolean | void>
4557 >;
4558 unhandledExpressionMemberChain: HookMap<
4559 SyncBailHook<[Expression, string[]], boolean | void>
4560 >;
4561 expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
4562 expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
4563 program: SyncBailHook<[Program, Comment[]], boolean | void>;
4564 finish: SyncBailHook<[Program, Comment[]], boolean | void>;
4565 }>;
4566 sourceType: "module" | "script" | "auto";
4567 scope: ScopeInfo;
4568 state: ParserState;
4569 comments: any;
4570 semicolons: any;
4571 statementPath: (
4572 | UnaryExpression
4573 | ThisExpression
4574 | ArrayExpression
4575 | ObjectExpression
4576 | FunctionExpression
4577 | ArrowFunctionExpression
4578 | YieldExpression
4579 | SimpleLiteral
4580 | RegExpLiteral
4581 | UpdateExpression
4582 | BinaryExpression
4583 | AssignmentExpression
4584 | LogicalExpression
4585 | MemberExpression
4586 | ConditionalExpression
4587 | SimpleCallExpression
4588 | NewExpression
4589 | SequenceExpression
4590 | TemplateLiteral
4591 | TaggedTemplateExpression
4592 | ClassExpression
4593 | MetaProperty
4594 | Identifier
4595 | AwaitExpression
4596 | ImportExpression
4597 | ChainExpression
4598 | FunctionDeclaration
4599 | VariableDeclaration
4600 | ClassDeclaration
4601 | ExpressionStatement
4602 | BlockStatement
4603 | EmptyStatement
4604 | DebuggerStatement
4605 | WithStatement
4606 | ReturnStatement
4607 | LabeledStatement
4608 | BreakStatement
4609 | ContinueStatement
4610 | IfStatement
4611 | SwitchStatement
4612 | ThrowStatement
4613 | TryStatement
4614 | WhileStatement
4615 | DoWhileStatement
4616 | ForStatement
4617 | ForInStatement
4618 | ForOfStatement
4619 )[];
4620 prevStatement: any;
4621 currentTagData: any;
4622 getRenameIdentifier(expr?: any): undefined | string;
4623 walkClass(classy: ClassExpression | ClassDeclaration): void;
4624 walkMethodDefinition(methodDefinition?: any): void;
4625 preWalkStatements(statements?: any): void;
4626 blockPreWalkStatements(statements?: any): void;
4627 walkStatements(statements?: any): void;
4628 preWalkStatement(statement?: any): void;
4629 blockPreWalkStatement(statement?: any): void;
4630 walkStatement(statement?: any): void;
4631
4632 /**
4633 * Walks a statements that is nested within a parent statement
4634 * and can potentially be a non-block statement.
4635 * This enforces the nested statement to never be in ASI position.
4636 */
4637 walkNestedStatement(statement: Statement): void;
4638 preWalkBlockStatement(statement?: any): void;
4639 walkBlockStatement(statement?: any): void;
4640 walkExpressionStatement(statement?: any): void;
4641 preWalkIfStatement(statement?: any): void;
4642 walkIfStatement(statement?: any): void;
4643 preWalkLabeledStatement(statement?: any): void;
4644 walkLabeledStatement(statement?: any): void;
4645 preWalkWithStatement(statement?: any): void;
4646 walkWithStatement(statement?: any): void;
4647 preWalkSwitchStatement(statement?: any): void;
4648 walkSwitchStatement(statement?: any): void;
4649 walkTerminatingStatement(statement?: any): void;
4650 walkReturnStatement(statement?: any): void;
4651 walkThrowStatement(statement?: any): void;
4652 preWalkTryStatement(statement?: any): void;
4653 walkTryStatement(statement?: any): void;
4654 preWalkWhileStatement(statement?: any): void;
4655 walkWhileStatement(statement?: any): void;
4656 preWalkDoWhileStatement(statement?: any): void;
4657 walkDoWhileStatement(statement?: any): void;
4658 preWalkForStatement(statement?: any): void;
4659 walkForStatement(statement?: any): void;
4660 preWalkForInStatement(statement?: any): void;
4661 walkForInStatement(statement?: any): void;
4662 preWalkForOfStatement(statement?: any): void;
4663 walkForOfStatement(statement?: any): void;
4664 preWalkFunctionDeclaration(statement?: any): void;
4665 walkFunctionDeclaration(statement?: any): void;
4666 blockPreWalkImportDeclaration(statement?: any): void;
4667 enterDeclaration(declaration?: any, onIdent?: any): void;
4668 blockPreWalkExportNamedDeclaration(statement?: any): void;
4669 walkExportNamedDeclaration(statement?: any): void;
4670 blockPreWalkExportDefaultDeclaration(statement?: any): void;
4671 walkExportDefaultDeclaration(statement?: any): void;
4672 blockPreWalkExportAllDeclaration(statement?: any): void;
4673 preWalkVariableDeclaration(statement?: any): void;
4674 blockPreWalkVariableDeclaration(statement?: any): void;
4675 walkVariableDeclaration(statement?: any): void;
4676 blockPreWalkClassDeclaration(statement?: any): void;
4677 walkClassDeclaration(statement?: any): void;
4678 preWalkSwitchCases(switchCases?: any): void;
4679 walkSwitchCases(switchCases?: any): void;
4680 preWalkCatchClause(catchClause?: any): void;
4681 walkCatchClause(catchClause?: any): void;
4682 walkPattern(pattern?: any): void;
4683 walkAssignmentPattern(pattern?: any): void;
4684 walkObjectPattern(pattern?: any): void;
4685 walkArrayPattern(pattern?: any): void;
4686 walkRestElement(pattern?: any): void;
4687 walkExpressions(expressions?: any): void;
4688 walkExpression(expression?: any): void;
4689 walkAwaitExpression(expression?: any): void;
4690 walkArrayExpression(expression?: any): void;
4691 walkSpreadElement(expression?: any): void;
4692 walkObjectExpression(expression?: any): void;
4693 walkProperty(prop?: any): void;
4694 walkFunctionExpression(expression?: any): void;
4695 walkArrowFunctionExpression(expression?: any): void;
4696 walkSequenceExpression(expression: SequenceExpression): void;
4697 walkUpdateExpression(expression?: any): void;
4698 walkUnaryExpression(expression?: any): void;
4699 walkLeftRightExpression(expression?: any): void;
4700 walkBinaryExpression(expression?: any): void;
4701 walkLogicalExpression(expression?: any): void;
4702 walkAssignmentExpression(expression?: any): void;
4703 walkConditionalExpression(expression?: any): void;
4704 walkNewExpression(expression?: any): void;
4705 walkYieldExpression(expression?: any): void;
4706 walkTemplateLiteral(expression?: any): void;
4707 walkTaggedTemplateExpression(expression?: any): void;
4708 walkClassExpression(expression?: any): void;
4709 walkChainExpression(expression: ChainExpression): void;
4710 walkImportExpression(expression?: any): void;
4711 walkCallExpression(expression?: any): void;
4712 walkMemberExpression(expression?: any): void;
4713 walkMemberExpressionWithExpressionName(
4714 expression?: any,
4715 name?: any,
4716 rootInfo?: any,
4717 members?: any,
4718 onUnhandled?: any
4719 ): void;
4720 walkThisExpression(expression?: any): void;
4721 walkIdentifier(expression?: any): void;
4722 walkMetaProperty(metaProperty: MetaProperty): void;
4723 callHooksForExpression(hookMap: any, expr: any, ...args: any[]): any;
4724 callHooksForExpressionWithFallback<T, R>(
4725 hookMap: HookMap<SyncBailHook<T, R>>,
4726 expr: MemberExpression,
4727 fallback: (
4728 arg0: string,
4729 arg1: string | ScopeInfo | VariableInfo,
4730 arg2: () => string[]
4731 ) => any,
4732 defined: (arg0: string) => any,
4733 ...args: AsArray<T>
4734 ): R;
4735 callHooksForName<T, R>(
4736 hookMap: HookMap<SyncBailHook<T, R>>,
4737 name: string,
4738 ...args: AsArray<T>
4739 ): R;
4740 callHooksForInfo<T, R>(
4741 hookMap: HookMap<SyncBailHook<T, R>>,
4742 info: ExportedVariableInfo,
4743 ...args: AsArray<T>
4744 ): R;
4745 callHooksForInfoWithFallback<T, R>(
4746 hookMap: HookMap<SyncBailHook<T, R>>,
4747 info: ExportedVariableInfo,
4748 fallback: (arg0: string) => any,
4749 defined: () => any,
4750 ...args: AsArray<T>
4751 ): R;
4752 callHooksForNameWithFallback<T, R>(
4753 hookMap: HookMap<SyncBailHook<T, R>>,
4754 name: string,
4755 fallback: (arg0: string) => any,
4756 defined: () => any,
4757 ...args: AsArray<T>
4758 ): R;
4759 inScope(params: any, fn: () => void): void;
4760 inFunctionScope(hasThis?: any, params?: any, fn?: any): void;
4761 inBlockScope(fn?: any): void;
4762 detectMode(statements?: any): void;
4763 enterPatterns(patterns?: any, onIdent?: any): void;
4764 enterPattern(pattern?: any, onIdent?: any): void;
4765 enterIdentifier(pattern?: any, onIdent?: any): void;
4766 enterObjectPattern(pattern?: any, onIdent?: any): void;
4767 enterArrayPattern(pattern?: any, onIdent?: any): void;
4768 enterRestElement(pattern?: any, onIdent?: any): void;
4769 enterAssignmentPattern(pattern?: any, onIdent?: any): void;
4770 evaluateExpression(
4771 expression: Expression
4772 ): undefined | BasicEvaluatedExpression;
4773 parseString(expression?: any): any;
4774 parseCalculatedString(expression?: any): any;
4775 evaluate(source?: any): undefined | BasicEvaluatedExpression;
4776 isPure(
4777 expr:
4778 | undefined
4779 | null
4780 | UnaryExpression
4781 | ThisExpression
4782 | ArrayExpression
4783 | ObjectExpression
4784 | FunctionExpression
4785 | ArrowFunctionExpression
4786 | YieldExpression
4787 | SimpleLiteral
4788 | RegExpLiteral
4789 | UpdateExpression
4790 | BinaryExpression
4791 | AssignmentExpression
4792 | LogicalExpression
4793 | MemberExpression
4794 | ConditionalExpression
4795 | SimpleCallExpression
4796 | NewExpression
4797 | SequenceExpression
4798 | TemplateLiteral
4799 | TaggedTemplateExpression
4800 | ClassExpression
4801 | MetaProperty
4802 | Identifier
4803 | AwaitExpression
4804 | ImportExpression
4805 | ChainExpression
4806 | FunctionDeclaration
4807 | VariableDeclaration
4808 | ClassDeclaration,
4809 commentsStartPos: number
4810 ): boolean;
4811 getComments(range?: any): any[];
4812 isAsiPosition(pos: number): boolean;
4813 unsetAsiPosition(pos: number): void;
4814 isStatementLevelExpression(expr?: any): boolean;
4815 getTagData(name?: any, tag?: any): any;
4816 tagVariable(name?: any, tag?: any, data?: any): void;
4817 defineVariable(name?: any): void;
4818 undefineVariable(name?: any): void;
4819 isVariableDefined(name?: any): boolean;
4820 getVariableInfo(name: string): ExportedVariableInfo;
4821 setVariable(name: string, variableInfo: ExportedVariableInfo): void;
4822 parseCommentOptions(
4823 range?: any
4824 ): { options: null; errors: null } | { options: object; errors: any[] };
4825 extractMemberExpressionChain(
4826 expression: MemberExpression
4827 ): {
4828 members: string[];
4829 object:
4830 | UnaryExpression
4831 | ThisExpression
4832 | ArrayExpression
4833 | ObjectExpression
4834 | FunctionExpression
4835 | ArrowFunctionExpression
4836 | YieldExpression
4837 | SimpleLiteral
4838 | RegExpLiteral
4839 | UpdateExpression
4840 | BinaryExpression
4841 | AssignmentExpression
4842 | LogicalExpression
4843 | MemberExpression
4844 | ConditionalExpression
4845 | SimpleCallExpression
4846 | NewExpression
4847 | SequenceExpression
4848 | TemplateLiteral
4849 | TaggedTemplateExpression
4850 | ClassExpression
4851 | MetaProperty
4852 | Identifier
4853 | AwaitExpression
4854 | ImportExpression
4855 | ChainExpression
4856 | Super;
4857 };
4858 getFreeInfoFromVariable(
4859 varName: string
4860 ): { name: string; info: string | VariableInfo };
4861 getMemberExpressionInfo(
4862 expression: MemberExpression,
4863 allowedTypes: number
4864 ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
4865 getNameForExpression(
4866 expression: MemberExpression
4867 ): {
4868 name: string;
4869 rootInfo: ExportedVariableInfo;
4870 getMembers: () => string[];
4871 };
4872 static ALLOWED_MEMBER_TYPES_ALL: 3;
4873 static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
4874 static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
4875}
4876
4877/**
4878 * Parser options for javascript modules.
4879 */
4880declare interface JavascriptParserOptions {
4881 [index: string]: any;
4882
4883 /**
4884 * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
4885 */
4886 amd?: false | { [index: string]: any };
4887
4888 /**
4889 * Enable/disable special handling for browserify bundles.
4890 */
4891 browserify?: boolean;
4892
4893 /**
4894 * Enable/disable parsing of CommonJs syntax.
4895 */
4896 commonjs?: boolean;
4897
4898 /**
4899 * Enable/disable parsing of magic comments in CommonJs syntax.
4900 */
4901 commonjsMagicComments?: boolean;
4902
4903 /**
4904 * Enable warnings for full dynamic dependencies.
4905 */
4906 exprContextCritical?: boolean;
4907
4908 /**
4909 * Enable recursive directory lookup for full dynamic dependencies.
4910 */
4911 exprContextRecursive?: boolean;
4912
4913 /**
4914 * Sets the default regular expression for full dynamic dependencies.
4915 */
4916 exprContextRegExp?: boolean | RegExp;
4917
4918 /**
4919 * Set the default request for full dynamic dependencies.
4920 */
4921 exprContextRequest?: string;
4922
4923 /**
4924 * Enable/disable parsing of EcmaScript Modules syntax.
4925 */
4926 harmony?: boolean;
4927
4928 /**
4929 * Enable/disable parsing of import() syntax.
4930 */
4931 import?: boolean;
4932
4933 /**
4934 * Include polyfills or mocks for various node stuff.
4935 */
4936 node?: false | NodeOptions;
4937
4938 /**
4939 * Enable/disable parsing of require.context syntax.
4940 */
4941 requireContext?: boolean;
4942
4943 /**
4944 * Enable/disable parsing of require.ensure syntax.
4945 */
4946 requireEnsure?: boolean;
4947
4948 /**
4949 * Enable/disable parsing of require.include syntax.
4950 */
4951 requireInclude?: boolean;
4952
4953 /**
4954 * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
4955 */
4956 requireJs?: boolean;
4957
4958 /**
4959 * Emit errors instead of warnings when imported names don't exist in imported module.
4960 */
4961 strictExportPresence?: boolean;
4962
4963 /**
4964 * Handle the this context correctly according to the spec for namespace objects.
4965 */
4966 strictThisContextOnImports?: boolean;
4967
4968 /**
4969 * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
4970 */
4971 system?: boolean;
4972
4973 /**
4974 * Enable warnings when using the require function in a not statically analyse-able way.
4975 */
4976 unknownContextCritical?: boolean;
4977
4978 /**
4979 * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
4980 */
4981 unknownContextRecursive?: boolean;
4982
4983 /**
4984 * Sets the regular expression when using the require function in a not statically analyse-able way.
4985 */
4986 unknownContextRegExp?: boolean | RegExp;
4987
4988 /**
4989 * Sets the request when using the require function in a not statically analyse-able way.
4990 */
4991 unknownContextRequest?: string;
4992
4993 /**
4994 * Enable/disable parsing of new URL() syntax.
4995 */
4996 url?: boolean | "relative";
4997
4998 /**
4999 * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
5000 */
5001 worker?: boolean | string[];
5002
5003 /**
5004 * Enable warnings for partial dynamic dependencies.
5005 */
5006 wrappedContextCritical?: boolean;
5007
5008 /**
5009 * Enable recursive directory lookup for partial dynamic dependencies.
5010 */
5011 wrappedContextRecursive?: boolean;
5012
5013 /**
5014 * Set the inner regular expression for partial dynamic dependencies.
5015 */
5016 wrappedContextRegExp?: RegExp;
5017}
5018declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
5019 constructor(runtimeRequirements?: any);
5020 static getCompilationHooks(
5021 compilation: Compilation
5022 ): JsonpCompilationPluginHooks;
5023
5024 /**
5025 * Runtime modules without any dependencies to other runtime modules
5026 */
5027 static STAGE_NORMAL: number;
5028
5029 /**
5030 * Runtime modules with simple dependencies on other runtime modules
5031 */
5032 static STAGE_BASIC: number;
5033
5034 /**
5035 * Runtime modules which attach to handlers of other runtime modules
5036 */
5037 static STAGE_ATTACH: number;
5038
5039 /**
5040 * Runtime modules which trigger actions on bootstrap
5041 */
5042 static STAGE_TRIGGER: number;
5043}
5044declare interface JsonpCompilationPluginHooks {
5045 linkPreload: SyncWaterfallHook<[string, Chunk]>;
5046 linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
5047}
5048declare class JsonpTemplatePlugin {
5049 constructor();
5050
5051 /**
5052 * Apply the plugin
5053 */
5054 apply(compiler: Compiler): void;
5055 static getCompilationHooks(
5056 compilation: Compilation
5057 ): JsonpCompilationPluginHooks;
5058}
5059declare interface KnownAssetInfo {
5060 /**
5061 * true, if the asset can be long term cached forever (contains a hash)
5062 */
5063 immutable?: boolean;
5064
5065 /**
5066 * whether the asset is minimized
5067 */
5068 minimized?: boolean;
5069
5070 /**
5071 * the value(s) of the full hash used for this asset
5072 */
5073 fullhash?: string | string[];
5074
5075 /**
5076 * the value(s) of the chunk hash used for this asset
5077 */
5078 chunkhash?: string | string[];
5079
5080 /**
5081 * the value(s) of the module hash used for this asset
5082 */
5083 modulehash?: string | string[];
5084
5085 /**
5086 * the value(s) of the content hash used for this asset
5087 */
5088 contenthash?: string | string[];
5089
5090 /**
5091 * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
5092 */
5093 sourceFilename?: string;
5094
5095 /**
5096 * size in bytes, only set after asset has been emitted
5097 */
5098 size?: number;
5099
5100 /**
5101 * true, when asset is only used for development and doesn't count towards user-facing assets
5102 */
5103 development?: boolean;
5104
5105 /**
5106 * true, when asset ships data for updating an existing application (HMR)
5107 */
5108 hotModuleReplacement?: boolean;
5109
5110 /**
5111 * true, when asset is javascript and an ESM
5112 */
5113 javascriptModule?: boolean;
5114
5115 /**
5116 * object of pointers to other assets, keyed by type of relation (only points from parent to child)
5117 */
5118 related?: Record<string, string | string[]>;
5119}
5120declare interface KnownBuildMeta {
5121 moduleArgument?: string;
5122 exportsArgument?: string;
5123 strict?: boolean;
5124 moduleConcatenationBailout?: string;
5125 exportsType?: "namespace" | "dynamic" | "default" | "flagged";
5126 defaultObject?: false | "redirect" | "redirect-warn";
5127 strictHarmonyModule?: boolean;
5128 async?: boolean;
5129 sideEffectFree?: boolean;
5130}
5131declare interface KnownCreateStatsOptionsContext {
5132 forToString?: boolean;
5133}
5134declare interface KnownNormalizedStatsOptions {
5135 context: string;
5136 requestShortener: RequestShortener;
5137 chunksSort: string;
5138 modulesSort: string;
5139 chunkModulesSort: string;
5140 nestedModulesSort: string;
5141 assetsSort: string;
5142 ids: boolean;
5143 cachedAssets: boolean;
5144 groupAssetsByEmitStatus: boolean;
5145 groupAssetsByPath: boolean;
5146 groupAssetsByExtension: boolean;
5147 assetsSpace: number;
5148 excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
5149 excludeModules: ((
5150 name: string,
5151 module: StatsModule,
5152 type: "module" | "chunk" | "root-of-chunk" | "nested"
5153 ) => boolean)[];
5154 warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
5155 cachedModules: boolean;
5156 orphanModules: boolean;
5157 dependentModules: boolean;
5158 runtimeModules: boolean;
5159 groupModulesByCacheStatus: boolean;
5160 groupModulesByLayer: boolean;
5161 groupModulesByAttributes: boolean;
5162 groupModulesByPath: boolean;
5163 groupModulesByExtension: boolean;
5164 groupModulesByType: boolean;
5165 entrypoints: boolean | "auto";
5166 chunkGroups: boolean;
5167 chunkGroupAuxiliary: boolean;
5168 chunkGroupChildren: boolean;
5169 chunkGroupMaxAssets: number;
5170 modulesSpace: number;
5171 chunkModulesSpace: number;
5172 nestedModulesSpace: number;
5173 logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
5174 loggingDebug: ((value: string) => boolean)[];
5175 loggingTrace: boolean;
5176}
5177declare interface KnownStatsAsset {
5178 type: string;
5179 name: string;
5180 info: AssetInfo;
5181 size: number;
5182 emitted: boolean;
5183 comparedForEmit: boolean;
5184 cached: boolean;
5185 related?: StatsAsset[];
5186 chunkNames?: (string | number)[];
5187 chunkIdHints?: (string | number)[];
5188 chunks?: (string | number)[];
5189 auxiliaryChunkNames?: (string | number)[];
5190 auxiliaryChunks?: (string | number)[];
5191 auxiliaryChunkIdHints?: (string | number)[];
5192 filteredRelated?: number;
5193 isOverSizeLimit?: boolean;
5194}
5195declare interface KnownStatsChunk {
5196 rendered: boolean;
5197 initial: boolean;
5198 entry: boolean;
5199 recorded: boolean;
5200 reason?: string;
5201 size: number;
5202 sizes?: Record<string, number>;
5203 names?: string[];
5204 idHints?: string[];
5205 runtime?: string[];
5206 files?: string[];
5207 auxiliaryFiles?: string[];
5208 hash: string;
5209 childrenByOrder?: Record<string, (string | number)[]>;
5210 id?: string | number;
5211 siblings?: (string | number)[];
5212 parents?: (string | number)[];
5213 children?: (string | number)[];
5214 modules?: StatsModule[];
5215 filteredModules?: number;
5216 origins?: StatsChunkOrigin[];
5217}
5218declare interface KnownStatsChunkGroup {
5219 name?: string;
5220 chunks?: (string | number)[];
5221 assets?: { name: string; size?: number }[];
5222 filteredAssets?: number;
5223 assetsSize?: number;
5224 auxiliaryAssets?: { name: string; size?: number }[];
5225 filteredAuxiliaryAssets?: number;
5226 auxiliaryAssetsSize?: number;
5227 children?: { [index: string]: StatsChunkGroup[] };
5228 childAssets?: { [index: string]: string[] };
5229 isOverSizeLimit?: boolean;
5230}
5231declare interface KnownStatsChunkOrigin {
5232 module?: string;
5233 moduleIdentifier?: string;
5234 moduleName?: string;
5235 loc?: string;
5236 request?: string;
5237 moduleId?: string | number;
5238}
5239declare interface KnownStatsCompilation {
5240 env?: any;
5241 name?: string;
5242 hash?: string;
5243 version?: string;
5244 time?: number;
5245 builtAt?: number;
5246 needAdditionalPass?: boolean;
5247 publicPath?: string;
5248 outputPath?: string;
5249 assetsByChunkName?: Record<string, string[]>;
5250 assets?: StatsAsset[];
5251 filteredAssets?: number;
5252 chunks?: StatsChunk[];
5253 modules?: StatsModule[];
5254 filteredModules?: number;
5255 entrypoints?: Record<string, StatsChunkGroup>;
5256 namedChunkGroups?: Record<string, StatsChunkGroup>;
5257 errors?: StatsError[];
5258 errorsCount?: number;
5259 warnings?: StatsError[];
5260 warningsCount?: number;
5261 children?: StatsCompilation[];
5262 logging?: Record<string, StatsLogging>;
5263}
5264declare interface KnownStatsError {
5265 message: string;
5266 chunkName?: string;
5267 chunkEntry?: boolean;
5268 chunkInitial?: boolean;
5269 file?: string;
5270 moduleIdentifier?: string;
5271 moduleName?: string;
5272 loc?: string;
5273 chunkId?: string | number;
5274 moduleId?: string | number;
5275 moduleTrace?: StatsModuleTraceItem[];
5276 details?: any;
5277 stack?: string;
5278}
5279declare interface KnownStatsFactoryContext {
5280 type: string;
5281 makePathsRelative?: (arg0: string) => string;
5282 compilation?: Compilation;
5283 rootModules?: Set<Module>;
5284 compilationFileToChunks?: Map<string, Chunk[]>;
5285 compilationAuxiliaryFileToChunks?: Map<string, Chunk[]>;
5286 runtime?: RuntimeSpec;
5287 cachedGetErrors?: (arg0: Compilation) => WebpackError[];
5288 cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
5289}
5290declare interface KnownStatsLogging {
5291 entries: StatsLoggingEntry[];
5292 filteredEntries: number;
5293 debug: boolean;
5294}
5295declare interface KnownStatsLoggingEntry {
5296 type: string;
5297 message: string;
5298 trace?: string[];
5299 children?: StatsLoggingEntry[];
5300 args?: any[];
5301 time?: number;
5302}
5303declare interface KnownStatsModule {
5304 type?: string;
5305 moduleType?: string;
5306 layer?: string;
5307 identifier?: string;
5308 name?: string;
5309 nameForCondition?: string;
5310 index?: number;
5311 preOrderIndex?: number;
5312 index2?: number;
5313 postOrderIndex?: number;
5314 size?: number;
5315 sizes?: { [index: string]: number };
5316 cacheable?: boolean;
5317 built?: boolean;
5318 codeGenerated?: boolean;
5319 cached?: boolean;
5320 optional?: boolean;
5321 orphan?: boolean;
5322 id?: string | number;
5323 issuerId?: string | number;
5324 chunks?: (string | number)[];
5325 assets?: (string | number)[];
5326 dependent?: boolean;
5327 issuer?: string;
5328 issuerName?: string;
5329 issuerPath?: StatsModuleIssuer[];
5330 failed?: boolean;
5331 errors?: number;
5332 warnings?: number;
5333 profile?: StatsProfile;
5334 reasons?: StatsModuleReason[];
5335 usedExports?: boolean | string[];
5336 providedExports?: string[];
5337 optimizationBailout?: string[];
5338 depth?: number;
5339 modules?: StatsModule[];
5340 filteredModules?: number;
5341 source?: string | Buffer;
5342}
5343declare interface KnownStatsModuleIssuer {
5344 identifier?: string;
5345 name?: string;
5346 id?: string | number;
5347 profile?: StatsProfile;
5348}
5349declare interface KnownStatsModuleReason {
5350 moduleIdentifier?: string;
5351 module?: string;
5352 moduleName?: string;
5353 resolvedModuleIdentifier?: string;
5354 resolvedModule?: string;
5355 type?: string;
5356 active: boolean;
5357 explanation?: string;
5358 userRequest?: string;
5359 loc?: string;
5360 moduleId?: string | number;
5361 resolvedModuleId?: string | number;
5362}
5363declare interface KnownStatsModuleTraceDependency {
5364 loc?: string;
5365}
5366declare interface KnownStatsModuleTraceItem {
5367 originIdentifier?: string;
5368 originName?: string;
5369 moduleIdentifier?: string;
5370 moduleName?: string;
5371 dependencies?: StatsModuleTraceDependency[];
5372 originId?: string | number;
5373 moduleId?: string | number;
5374}
5375declare interface KnownStatsPrinterContext {
5376 type?: string;
5377 compilation?: StatsCompilation;
5378 chunkGroup?: StatsChunkGroup;
5379 asset?: StatsAsset;
5380 module?: StatsModule;
5381 chunk?: StatsChunk;
5382 moduleReason?: StatsModuleReason;
5383 bold?: (str: string) => string;
5384 yellow?: (str: string) => string;
5385 red?: (str: string) => string;
5386 green?: (str: string) => string;
5387 magenta?: (str: string) => string;
5388 cyan?: (str: string) => string;
5389 formatFilename?: (file: string, oversize?: boolean) => string;
5390 formatModuleId?: (id: string) => string;
5391 formatChunkId?: (
5392 id: string,
5393 direction?: "parent" | "child" | "sibling"
5394 ) => string;
5395 formatSize?: (size: number) => string;
5396 formatDateTime?: (dateTime: number) => string;
5397 formatFlag?: (flag: string) => string;
5398 formatTime?: (time: number, boldQuantity?: boolean) => string;
5399 chunkGroupKind?: string;
5400}
5401declare interface KnownStatsProfile {
5402 total: number;
5403 resolving: number;
5404 restoring: number;
5405 building: number;
5406 integration: number;
5407 storing: number;
5408 additionalResolving: number;
5409 additionalIntegration: number;
5410 factory: number;
5411 dependencies: number;
5412}
5413declare class LazySet<T> {
5414 constructor(iterable?: Iterable<T>);
5415 readonly size: number;
5416 add(item: T): LazySet<T>;
5417 addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
5418 clear(): void;
5419 delete(value: T): boolean;
5420 entries(): IterableIterator<[T, T]>;
5421 forEach(
5422 callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
5423 thisArg?: any
5424 ): void;
5425 has(item: T): boolean;
5426 keys(): IterableIterator<T>;
5427 values(): IterableIterator<T>;
5428 [Symbol.iterator](): IterableIterator<T>;
5429 readonly [Symbol.toStringTag]: string;
5430 serialize(__0: { write: any }): void;
5431 static deserialize(__0: { read: any }): LazySet<any>;
5432}
5433declare interface LibIdentOptions {
5434 /**
5435 * absolute context path to which lib ident is relative to
5436 */
5437 context: string;
5438
5439 /**
5440 * object for caching
5441 */
5442 associatedObjectForCache?: Object;
5443}
5444declare class LibManifestPlugin {
5445 constructor(options?: any);
5446 options: any;
5447
5448 /**
5449 * Apply the plugin
5450 */
5451 apply(compiler: Compiler): void;
5452}
5453declare interface LibraryContext<T> {
5454 compilation: Compilation;
5455 options: T;
5456}
5457
5458/**
5459 * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
5460 */
5461declare interface LibraryCustomUmdCommentObject {
5462 /**
5463 * Set comment for `amd` section in UMD.
5464 */
5465 amd?: string;
5466
5467 /**
5468 * Set comment for `commonjs` (exports) section in UMD.
5469 */
5470 commonjs?: string;
5471
5472 /**
5473 * Set comment for `commonjs2` (module.exports) section in UMD.
5474 */
5475 commonjs2?: string;
5476
5477 /**
5478 * Set comment for `root` (global variable) section in UMD.
5479 */
5480 root?: string;
5481}
5482
5483/**
5484 * Description object for all UMD variants of the library name.
5485 */
5486declare interface LibraryCustomUmdObject {
5487 /**
5488 * Name of the exposed AMD library in the UMD.
5489 */
5490 amd?: string;
5491
5492 /**
5493 * Name of the exposed commonjs export in the UMD.
5494 */
5495 commonjs?: string;
5496
5497 /**
5498 * Name of the property exposed globally by a UMD library.
5499 */
5500 root?: string | string[];
5501}
5502type LibraryExport = string | string[];
5503type LibraryName = string | string[] | LibraryCustomUmdObject;
5504
5505/**
5506 * Options for library.
5507 */
5508declare interface LibraryOptions {
5509 /**
5510 * Add a comment in the UMD wrapper.
5511 */
5512 auxiliaryComment?: string | LibraryCustomUmdCommentObject;
5513
5514 /**
5515 * Specify which export should be exposed as library.
5516 */
5517 export?: string | string[];
5518
5519 /**
5520 * The name of the library (some types allow unnamed libraries too).
5521 */
5522 name?: string | string[] | LibraryCustomUmdObject;
5523
5524 /**
5525 * 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).
5526 */
5527 type: string;
5528
5529 /**
5530 * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
5531 */
5532 umdNamedDefine?: boolean;
5533}
5534declare class LibraryTemplatePlugin {
5535 constructor(
5536 name: LibraryName,
5537 target: string,
5538 umdNamedDefine: boolean,
5539 auxiliaryComment: AuxiliaryComment,
5540 exportProperty: LibraryExport
5541 );
5542 library: {
5543 type: string;
5544 name: LibraryName;
5545 umdNamedDefine: boolean;
5546 auxiliaryComment: AuxiliaryComment;
5547 export: LibraryExport;
5548 };
5549
5550 /**
5551 * Apply the plugin
5552 */
5553 apply(compiler: Compiler): void;
5554}
5555declare class LimitChunkCountPlugin {
5556 constructor(options?: LimitChunkCountPluginOptions);
5557 options?: LimitChunkCountPluginOptions;
5558 apply(compiler: Compiler): void;
5559}
5560declare interface LimitChunkCountPluginOptions {
5561 /**
5562 * Constant overhead for a chunk.
5563 */
5564 chunkOverhead?: number;
5565
5566 /**
5567 * Multiplicator for initial chunks.
5568 */
5569 entryChunkMultiplicator?: number;
5570
5571 /**
5572 * Limit the maximum number of chunks using a value greater greater than or equal to 1.
5573 */
5574 maxChunks: number;
5575}
5576declare interface LoadScriptCompilationHooks {
5577 createScript: SyncWaterfallHook<[string, Chunk]>;
5578}
5579declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
5580 constructor();
5581 static getCompilationHooks(
5582 compilation: Compilation
5583 ): LoadScriptCompilationHooks;
5584
5585 /**
5586 * Runtime modules without any dependencies to other runtime modules
5587 */
5588 static STAGE_NORMAL: number;
5589
5590 /**
5591 * Runtime modules with simple dependencies on other runtime modules
5592 */
5593 static STAGE_BASIC: number;
5594
5595 /**
5596 * Runtime modules which attach to handlers of other runtime modules
5597 */
5598 static STAGE_ATTACH: number;
5599
5600 /**
5601 * Runtime modules which trigger actions on bootstrap
5602 */
5603 static STAGE_TRIGGER: number;
5604}
5605
5606/**
5607 * Custom values available in the loader context.
5608 */
5609declare interface Loader {
5610 [index: string]: any;
5611}
5612declare interface LoaderItem {
5613 loader: string;
5614 options: any;
5615 ident: null | string;
5616 type: null | string;
5617}
5618declare class LoaderOptionsPlugin {
5619 constructor(options?: LoaderOptionsPluginOptions);
5620 options: LoaderOptionsPluginOptions;
5621
5622 /**
5623 * Apply the plugin
5624 */
5625 apply(compiler: Compiler): void;
5626}
5627declare interface LoaderOptionsPluginOptions {
5628 [index: string]: any;
5629
5630 /**
5631 * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
5632 */
5633 debug?: boolean;
5634
5635 /**
5636 * Where loaders can be switched to minimize mode.
5637 */
5638 minimize?: boolean;
5639
5640 /**
5641 * A configuration object that can be used to configure older loaders.
5642 */
5643 options?: {
5644 [index: string]: any;
5645 /**
5646 * The context that can be used to configure older loaders.
5647 */
5648 context?: string;
5649 };
5650}
5651declare class LoaderTargetPlugin {
5652 constructor(target: string);
5653 target: string;
5654
5655 /**
5656 * Apply the plugin
5657 */
5658 apply(compiler: Compiler): void;
5659}
5660declare interface LogEntry {
5661 type: string;
5662 args: any[];
5663 time: number;
5664 trace?: string[];
5665}
5666declare const MEASURE_END_OPERATION: unique symbol;
5667declare const MEASURE_START_OPERATION: unique symbol;
5668declare interface MainRenderContext {
5669 /**
5670 * the chunk
5671 */
5672 chunk: Chunk;
5673
5674 /**
5675 * the dependency templates
5676 */
5677 dependencyTemplates: DependencyTemplates;
5678
5679 /**
5680 * the runtime template
5681 */
5682 runtimeTemplate: RuntimeTemplate;
5683
5684 /**
5685 * the module graph
5686 */
5687 moduleGraph: ModuleGraph;
5688
5689 /**
5690 * the chunk graph
5691 */
5692 chunkGraph: ChunkGraph;
5693
5694 /**
5695 * results of code generation
5696 */
5697 codeGenerationResults: CodeGenerationResults;
5698
5699 /**
5700 * hash to be used for render call
5701 */
5702 hash: string;
5703}
5704declare abstract class MainTemplate {
5705 hooks: Readonly<{
5706 renderManifest: { tap: (options?: any, fn?: any) => void };
5707 modules: { tap: () => never };
5708 moduleObj: { tap: () => never };
5709 require: { tap: (options?: any, fn?: any) => void };
5710 beforeStartup: { tap: () => never };
5711 startup: { tap: () => never };
5712 afterStartup: { tap: () => never };
5713 render: { tap: (options?: any, fn?: any) => void };
5714 renderWithEntry: { tap: (options?: any, fn?: any) => void };
5715 assetPath: {
5716 tap: (options?: any, fn?: any) => void;
5717 call: (filename?: any, options?: any) => string;
5718 };
5719 hash: { tap: (options?: any, fn?: any) => void };
5720 hashForChunk: { tap: (options?: any, fn?: any) => void };
5721 globalHashPaths: { tap: () => void };
5722 globalHash: { tap: () => void };
5723 hotBootstrap: { tap: () => never };
5724 bootstrap: SyncWaterfallHook<
5725 [string, Chunk, string, ModuleTemplate, DependencyTemplates]
5726 >;
5727 localVars: SyncWaterfallHook<[string, Chunk, string]>;
5728 requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
5729 requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
5730 readonly jsonpScript: SyncWaterfallHook<[string, Chunk]>;
5731 readonly linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
5732 readonly linkPreload: SyncWaterfallHook<[string, Chunk]>;
5733 }>;
5734 renderCurrentHashCode: (hash: string, length?: number) => string;
5735 getPublicPath: (options: object) => string;
5736 getAssetPath: (path?: any, options?: any) => string;
5737 getAssetPathWithInfo: (
5738 path?: any,
5739 options?: any
5740 ) => { path: string; info: AssetInfo };
5741 readonly requireFn: "__webpack_require__";
5742 readonly outputOptions: Output;
5743}
5744declare interface MapOptions {
5745 columns?: boolean;
5746 module?: boolean;
5747}
5748
5749/**
5750 * Options object for in-memory caching.
5751 */
5752declare interface MemoryCacheOptions {
5753 /**
5754 * 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).
5755 */
5756 maxGenerations?: number;
5757
5758 /**
5759 * In memory caching.
5760 */
5761 type: "memory";
5762}
5763declare class MemoryCachePlugin {
5764 constructor();
5765
5766 /**
5767 * Apply the plugin
5768 */
5769 apply(compiler: Compiler): void;
5770}
5771declare class MinChunkSizePlugin {
5772 constructor(options: MinChunkSizePluginOptions);
5773 options: MinChunkSizePluginOptions;
5774
5775 /**
5776 * Apply the plugin
5777 */
5778 apply(compiler: Compiler): void;
5779}
5780declare interface MinChunkSizePluginOptions {
5781 /**
5782 * Constant overhead for a chunk.
5783 */
5784 chunkOverhead?: number;
5785
5786 /**
5787 * Multiplicator for initial chunks.
5788 */
5789 entryChunkMultiplicator?: number;
5790
5791 /**
5792 * Minimum number of characters.
5793 */
5794 minChunkSize: number;
5795}
5796declare class Module extends DependenciesBlock {
5797 constructor(type: string, context?: string, layer?: string);
5798 type: string;
5799 context: null | string;
5800 layer: null | string;
5801 needId: boolean;
5802 debugId: number;
5803 resolveOptions: ResolveOptionsWebpackOptions;
5804 factoryMeta?: object;
5805 useSourceMap: boolean;
5806 useSimpleSourceMap: boolean;
5807 buildMeta: BuildMeta;
5808 buildInfo: Record<string, any>;
5809 presentationalDependencies?: Dependency[];
5810 id: string | number;
5811 readonly hash: string;
5812 readonly renderedHash: string;
5813 profile: null | ModuleProfile;
5814 index: number;
5815 index2: number;
5816 depth: number;
5817 issuer: null | Module;
5818 readonly usedExports: null | boolean | SortableSet<string>;
5819 readonly optimizationBailout: (
5820 | string
5821 | ((requestShortener: RequestShortener) => string)
5822 )[];
5823 readonly optional: boolean;
5824 addChunk(chunk?: any): boolean;
5825 removeChunk(chunk?: any): void;
5826 isInChunk(chunk?: any): boolean;
5827 isEntryModule(): boolean;
5828 getChunks(): Chunk[];
5829 getNumberOfChunks(): number;
5830 readonly chunksIterable: Iterable<Chunk>;
5831 isProvided(exportName: string): null | boolean;
5832 readonly exportsArgument: string;
5833 readonly moduleArgument: string;
5834 getExportsType(
5835 moduleGraph: ModuleGraph,
5836 strict: boolean
5837 ): "namespace" | "default-only" | "default-with-named" | "dynamic";
5838 addPresentationalDependency(presentationalDependency: Dependency): void;
5839 addWarning(warning: WebpackError): void;
5840 getWarnings(): undefined | Iterable<WebpackError>;
5841 getNumberOfWarnings(): number;
5842 addError(error: WebpackError): void;
5843 getErrors(): undefined | Iterable<WebpackError>;
5844 getNumberOfErrors(): number;
5845
5846 /**
5847 * removes all warnings and errors
5848 */
5849 clearWarningsAndErrors(): void;
5850 isOptional(moduleGraph: ModuleGraph): boolean;
5851 isAccessibleInChunk(
5852 chunkGraph: ChunkGraph,
5853 chunk: Chunk,
5854 ignoreChunk?: Chunk
5855 ): boolean;
5856 isAccessibleInChunkGroup(
5857 chunkGraph: ChunkGraph,
5858 chunkGroup: ChunkGroup,
5859 ignoreChunk?: Chunk
5860 ): boolean;
5861 hasReasonForChunk(
5862 chunk: Chunk,
5863 moduleGraph: ModuleGraph,
5864 chunkGraph: ChunkGraph
5865 ): boolean;
5866 hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
5867 needBuild(
5868 context: NeedBuildContext,
5869 callback: (arg0?: WebpackError, arg1?: boolean) => void
5870 ): void;
5871 needRebuild(
5872 fileTimestamps: Map<string, null | number>,
5873 contextTimestamps: Map<string, null | number>
5874 ): boolean;
5875 invalidateBuild(): void;
5876 identifier(): string;
5877 readableIdentifier(requestShortener: RequestShortener): string;
5878 build(
5879 options: WebpackOptionsNormalized,
5880 compilation: Compilation,
5881 resolver: ResolverWithOptions,
5882 fs: InputFileSystem,
5883 callback: (arg0?: WebpackError) => void
5884 ): void;
5885 getSourceTypes(): Set<string>;
5886 source(
5887 dependencyTemplates: DependencyTemplates,
5888 runtimeTemplate: RuntimeTemplate,
5889 type?: string
5890 ): Source;
5891 size(type?: string): number;
5892 libIdent(options: LibIdentOptions): null | string;
5893 nameForCondition(): null | string;
5894 getConcatenationBailoutReason(
5895 context: ConcatenationBailoutReasonContext
5896 ): undefined | string;
5897 getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
5898 codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
5899 chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
5900
5901 /**
5902 * Assuming this module is in the cache. Update the (cached) module with
5903 * the fresh module from the factory. Usually updates internal references
5904 * and properties.
5905 */
5906 updateCacheModule(module: Module): void;
5907
5908 /**
5909 * Module should be unsafe cached. Get data that's needed for that.
5910 * This data will be passed to restoreFromUnsafeCache later.
5911 */
5912 getUnsafeCacheData(): object;
5913
5914 /**
5915 * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
5916 */
5917 cleanupForCache(): void;
5918 originalSource(): null | Source;
5919 addCacheDependencies(
5920 fileDependencies: LazySet<string>,
5921 contextDependencies: LazySet<string>,
5922 missingDependencies: LazySet<string>,
5923 buildDependencies: LazySet<string>
5924 ): void;
5925 readonly hasEqualsChunks: any;
5926 readonly isUsed: any;
5927 readonly errors: any;
5928 readonly warnings: any;
5929 used: any;
5930}
5931declare class ModuleConcatenationPlugin {
5932 constructor(options?: any);
5933 options: any;
5934
5935 /**
5936 * Apply the plugin
5937 */
5938 apply(compiler: Compiler): void;
5939}
5940declare class ModuleDependency extends Dependency {
5941 constructor(request: string);
5942 request: string;
5943 userRequest: string;
5944 range: any;
5945 static Template: typeof DependencyTemplate;
5946 static NO_EXPORTS_REFERENCED: string[][];
5947 static EXPORTS_OBJECT_REFERENCED: string[][];
5948}
5949declare abstract class ModuleFactory {
5950 create(
5951 data: ModuleFactoryCreateData,
5952 callback: (arg0?: Error, arg1?: ModuleFactoryResult) => void
5953 ): void;
5954}
5955declare interface ModuleFactoryCreateData {
5956 contextInfo: ModuleFactoryCreateDataContextInfo;
5957 resolveOptions?: ResolveOptionsWebpackOptions;
5958 context: string;
5959 dependencies: Dependency[];
5960}
5961declare interface ModuleFactoryCreateDataContextInfo {
5962 issuer: string;
5963 issuerLayer?: null | string;
5964 compiler: string;
5965}
5966declare interface ModuleFactoryResult {
5967 /**
5968 * the created module or unset if no module was created
5969 */
5970 module?: Module;
5971 fileDependencies?: Set<string>;
5972 contextDependencies?: Set<string>;
5973 missingDependencies?: Set<string>;
5974}
5975declare class ModuleFederationPlugin {
5976 constructor(options: ModuleFederationPluginOptions);
5977
5978 /**
5979 * Apply the plugin
5980 */
5981 apply(compiler: Compiler): void;
5982}
5983declare interface ModuleFederationPluginOptions {
5984 /**
5985 * 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.
5986 */
5987 exposes?: (string | ExposesObject)[] | ExposesObject;
5988
5989 /**
5990 * The filename of the container as relative path inside the `output.path` directory.
5991 */
5992 filename?: string;
5993
5994 /**
5995 * Options for library.
5996 */
5997 library?: LibraryOptions;
5998
5999 /**
6000 * The name of the container.
6001 */
6002 name?: string;
6003
6004 /**
6005 * The external type of the remote containers.
6006 */
6007 remoteType?:
6008 | "var"
6009 | "module"
6010 | "assign"
6011 | "this"
6012 | "window"
6013 | "self"
6014 | "global"
6015 | "commonjs"
6016 | "commonjs2"
6017 | "commonjs-module"
6018 | "amd"
6019 | "amd-require"
6020 | "umd"
6021 | "umd2"
6022 | "jsonp"
6023 | "system"
6024 | "promise"
6025 | "import"
6026 | "script";
6027
6028 /**
6029 * 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.
6030 */
6031 remotes?: (string | RemotesObject)[] | RemotesObject;
6032
6033 /**
6034 * Share scope name used for all shared modules (defaults to 'default').
6035 */
6036 shareScope?: string;
6037
6038 /**
6039 * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
6040 */
6041 shared?: (string | SharedObject)[] | SharedObject;
6042}
6043type ModuleFilterItemTypes =
6044 | string
6045 | RegExp
6046 | ((
6047 name: string,
6048 module: StatsModule,
6049 type: "module" | "chunk" | "root-of-chunk" | "nested"
6050 ) => boolean);
6051declare class ModuleGraph {
6052 constructor();
6053 setParents(
6054 dependency: Dependency,
6055 block: DependenciesBlock,
6056 module: Module
6057 ): void;
6058 getParentModule(dependency: Dependency): Module;
6059 getParentBlock(dependency: Dependency): DependenciesBlock;
6060 setResolvedModule(
6061 originModule: Module,
6062 dependency: Dependency,
6063 module: Module
6064 ): void;
6065 updateModule(dependency: Dependency, module: Module): void;
6066 removeConnection(dependency: Dependency): void;
6067 addExplanation(dependency: Dependency, explanation: string): void;
6068 cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
6069 removeModuleAttributes(module: Module): void;
6070 removeAllModuleAttributes(): void;
6071 moveModuleConnections(
6072 oldModule: Module,
6073 newModule: Module,
6074 filterConnection: (arg0: ModuleGraphConnection) => boolean
6075 ): void;
6076 copyOutgoingModuleConnections(
6077 oldModule: Module,
6078 newModule: Module,
6079 filterConnection: (arg0: ModuleGraphConnection) => boolean
6080 ): void;
6081 addExtraReason(module: Module, explanation: string): void;
6082 getResolvedModule(dependency: Dependency): Module;
6083 getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
6084 getModule(dependency: Dependency): Module;
6085 getOrigin(dependency: Dependency): Module;
6086 getResolvedOrigin(dependency: Dependency): Module;
6087 getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
6088 getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
6089 getIncomingConnectionsByOriginModule(
6090 module: Module
6091 ): Map<Module, ReadonlyArray<ModuleGraphConnection>>;
6092 getProfile(module: Module): null | ModuleProfile;
6093 setProfile(module: Module, profile: null | ModuleProfile): void;
6094 getIssuer(module: Module): null | Module;
6095 setIssuer(module: Module, issuer: null | Module): void;
6096 setIssuerIfUnset(module: Module, issuer: null | Module): void;
6097 getOptimizationBailout(
6098 module: Module
6099 ): (string | ((requestShortener: RequestShortener) => string))[];
6100 getProvidedExports(module: Module): null | true | string[];
6101 isExportProvided(
6102 module: Module,
6103 exportName: string | string[]
6104 ): null | boolean;
6105 getExportsInfo(module: Module): ExportsInfo;
6106 getExportInfo(module: Module, exportName: string): ExportInfo;
6107 getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
6108 getUsedExports(
6109 module: Module,
6110 runtime: RuntimeSpec
6111 ): null | boolean | SortableSet<string>;
6112 getPreOrderIndex(module: Module): number;
6113 getPostOrderIndex(module: Module): number;
6114 setPreOrderIndex(module: Module, index: number): void;
6115 setPreOrderIndexIfUnset(module: Module, index: number): boolean;
6116 setPostOrderIndex(module: Module, index: number): void;
6117 setPostOrderIndexIfUnset(module: Module, index: number): boolean;
6118 getDepth(module: Module): number;
6119 setDepth(module: Module, depth: number): void;
6120 setDepthIfLower(module: Module, depth: number): boolean;
6121 isAsync(module: Module): boolean;
6122 setAsync(module: Module): void;
6123 getMeta(thing?: any): Object;
6124 getMetaIfExisting(thing?: any): Object;
6125 static getModuleGraphForModule(
6126 module: Module,
6127 deprecateMessage: string,
6128 deprecationCode: string
6129 ): ModuleGraph;
6130 static setModuleGraphForModule(
6131 module: Module,
6132 moduleGraph: ModuleGraph
6133 ): void;
6134 static clearModuleGraphForModule(module: Module): void;
6135 static ModuleGraphConnection: typeof ModuleGraphConnection;
6136}
6137declare class ModuleGraphConnection {
6138 constructor(
6139 originModule: null | Module,
6140 dependency: null | Dependency,
6141 module: Module,
6142 explanation?: string,
6143 weak?: boolean,
6144 condition?:
6145 | false
6146 | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
6147 );
6148 originModule: null | Module;
6149 resolvedOriginModule: null | Module;
6150 dependency: null | Dependency;
6151 resolvedModule: Module;
6152 module: Module;
6153 weak: boolean;
6154 conditional: boolean;
6155 condition: (
6156 arg0: ModuleGraphConnection,
6157 arg1: RuntimeSpec
6158 ) => ConnectionState;
6159 explanations: Set<string>;
6160 clone(): ModuleGraphConnection;
6161 addCondition(
6162 condition: (
6163 arg0: ModuleGraphConnection,
6164 arg1: RuntimeSpec
6165 ) => ConnectionState
6166 ): void;
6167 addExplanation(explanation: string): void;
6168 readonly explanation: string;
6169 active: void;
6170 isActive(runtime: RuntimeSpec): boolean;
6171 isTargetActive(runtime: RuntimeSpec): boolean;
6172 getActiveState(runtime: RuntimeSpec): ConnectionState;
6173 setActive(value: boolean): void;
6174 static addConnectionStates: (
6175 a: ConnectionState,
6176 b: ConnectionState
6177 ) => ConnectionState;
6178 static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
6179 static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
6180}
6181type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
6182
6183/**
6184 * Options affecting the normal modules (`NormalModuleFactory`).
6185 */
6186declare interface ModuleOptions {
6187 /**
6188 * An array of rules applied by default for modules.
6189 */
6190 defaultRules?: (RuleSetRule | "...")[];
6191
6192 /**
6193 * Enable warnings for full dynamic dependencies.
6194 */
6195 exprContextCritical?: boolean;
6196
6197 /**
6198 * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
6199 */
6200 exprContextRecursive?: boolean;
6201
6202 /**
6203 * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
6204 */
6205 exprContextRegExp?: boolean | RegExp;
6206
6207 /**
6208 * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
6209 */
6210 exprContextRequest?: string;
6211
6212 /**
6213 * Specify options for each generator.
6214 */
6215 generator?: GeneratorOptionsByModuleType;
6216
6217 /**
6218 * Don't parse files matching. It's matched against the full resolved request.
6219 */
6220 noParse?: string | Function | RegExp | (string | Function | RegExp)[];
6221
6222 /**
6223 * Specify options for each parser.
6224 */
6225 parser?: ParserOptionsByModuleType;
6226
6227 /**
6228 * An array of rules applied for modules.
6229 */
6230 rules?: (RuleSetRule | "...")[];
6231
6232 /**
6233 * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
6234 */
6235 strictExportPresence?: boolean;
6236
6237 /**
6238 * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
6239 */
6240 strictThisContextOnImports?: boolean;
6241
6242 /**
6243 * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
6244 */
6245 unknownContextCritical?: boolean;
6246
6247 /**
6248 * 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'.
6249 */
6250 unknownContextRecursive?: boolean;
6251
6252 /**
6253 * 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'.
6254 */
6255 unknownContextRegExp?: boolean | RegExp;
6256
6257 /**
6258 * 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'.
6259 */
6260 unknownContextRequest?: string;
6261
6262 /**
6263 * Cache the resolving of module requests.
6264 */
6265 unsafeCache?: boolean | Function;
6266
6267 /**
6268 * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
6269 */
6270 wrappedContextCritical?: boolean;
6271
6272 /**
6273 * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
6274 */
6275 wrappedContextRecursive?: boolean;
6276
6277 /**
6278 * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
6279 */
6280 wrappedContextRegExp?: RegExp;
6281}
6282
6283/**
6284 * Options affecting the normal modules (`NormalModuleFactory`).
6285 */
6286declare interface ModuleOptionsNormalized {
6287 /**
6288 * An array of rules applied by default for modules.
6289 */
6290 defaultRules: (RuleSetRule | "...")[];
6291
6292 /**
6293 * Specify options for each generator.
6294 */
6295 generator: GeneratorOptionsByModuleType;
6296
6297 /**
6298 * Don't parse files matching. It's matched against the full resolved request.
6299 */
6300 noParse?: string | Function | RegExp | (string | Function | RegExp)[];
6301
6302 /**
6303 * Specify options for each parser.
6304 */
6305 parser: ParserOptionsByModuleType;
6306
6307 /**
6308 * An array of rules applied for modules.
6309 */
6310 rules: (RuleSetRule | "...")[];
6311
6312 /**
6313 * Cache the resolving of module requests.
6314 */
6315 unsafeCache?: boolean | Function;
6316}
6317declare interface ModulePathData {
6318 id: string | number;
6319 hash: string;
6320 hashWithLength?: (arg0: number) => string;
6321}
6322declare abstract class ModuleProfile {
6323 startTime: number;
6324 factoryStartTime: number;
6325 factoryEndTime: number;
6326 factory: number;
6327 factoryParallelismFactor: number;
6328 restoringStartTime: number;
6329 restoringEndTime: number;
6330 restoring: number;
6331 restoringParallelismFactor: number;
6332 integrationStartTime: number;
6333 integrationEndTime: number;
6334 integration: number;
6335 integrationParallelismFactor: number;
6336 buildingStartTime: number;
6337 buildingEndTime: number;
6338 building: number;
6339 buildingParallelismFactor: number;
6340 storingStartTime: number;
6341 storingEndTime: number;
6342 storing: number;
6343 storingParallelismFactor: number;
6344 additionalFactoryTimes: any;
6345 additionalFactories: number;
6346 additionalFactoriesParallelismFactor: number;
6347 additionalIntegration: number;
6348 markFactoryStart(): void;
6349 markFactoryEnd(): void;
6350 markRestoringStart(): void;
6351 markRestoringEnd(): void;
6352 markIntegrationStart(): void;
6353 markIntegrationEnd(): void;
6354 markBuildingStart(): void;
6355 markBuildingEnd(): void;
6356 markStoringStart(): void;
6357 markStoringEnd(): void;
6358
6359 /**
6360 * Merge this profile into another one
6361 */
6362 mergeInto(realProfile: ModuleProfile): void;
6363}
6364declare interface ModuleReferenceOptions {
6365 /**
6366 * the properties/exports of the module
6367 */
6368 ids: string[];
6369
6370 /**
6371 * true, when this referenced export is called
6372 */
6373 call: boolean;
6374
6375 /**
6376 * true, when this referenced export is directly imported (not via property access)
6377 */
6378 directImport: boolean;
6379
6380 /**
6381 * if the position is ASI safe or unknown
6382 */
6383 asiSafe?: boolean;
6384}
6385declare abstract class ModuleTemplate {
6386 type: string;
6387 hooks: Readonly<{
6388 content: { tap: (options?: any, fn?: any) => void };
6389 module: { tap: (options?: any, fn?: any) => void };
6390 render: { tap: (options?: any, fn?: any) => void };
6391 package: { tap: (options?: any, fn?: any) => void };
6392 hash: { tap: (options?: any, fn?: any) => void };
6393 }>;
6394 readonly runtimeTemplate: any;
6395}
6396declare class MultiCompiler {
6397 constructor(
6398 compilers: Compiler[] | Record<string, Compiler>,
6399 options: MultiCompilerOptions
6400 );
6401 hooks: Readonly<{
6402 done: SyncHook<[MultiStats]>;
6403 invalid: MultiHook<SyncHook<[null | string, number]>>;
6404 run: MultiHook<AsyncSeriesHook<[Compiler]>>;
6405 watchClose: SyncHook<[]>;
6406 watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
6407 infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
6408 }>;
6409 compilers: Compiler[];
6410 dependencies: WeakMap<Compiler, string[]>;
6411 running: boolean;
6412 readonly options: WebpackOptionsNormalized[] & MultiCompilerOptions;
6413 readonly outputPath: string;
6414 inputFileSystem: InputFileSystem;
6415 outputFileSystem: OutputFileSystem;
6416 watchFileSystem: WatchFileSystem;
6417 intermediateFileSystem: IntermediateFileSystem;
6418 getInfrastructureLogger(name?: any): WebpackLogger;
6419 setDependencies(compiler: Compiler, dependencies: string[]): void;
6420 validateDependencies(callback: CallbackFunction<MultiStats>): boolean;
6421 runWithDependencies(
6422 compilers: Compiler[],
6423 fn: (compiler: Compiler, callback: CallbackFunction<MultiStats>) => any,
6424 callback: CallbackFunction<MultiStats>
6425 ): void;
6426 watch(
6427 watchOptions: WatchOptions | WatchOptions[],
6428 handler: CallbackFunction<MultiStats>
6429 ): MultiWatching;
6430 run(callback: CallbackFunction<MultiStats>): void;
6431 purgeInputFileSystem(): void;
6432 close(callback: CallbackFunction<void>): void;
6433}
6434declare interface MultiCompilerOptions {
6435 /**
6436 * how many Compilers are allows to run at the same time in parallel
6437 */
6438 parallelism?: number;
6439}
6440declare abstract class MultiStats {
6441 stats: Stats[];
6442 readonly hash: string;
6443 hasErrors(): boolean;
6444 hasWarnings(): boolean;
6445 toJson(options?: any): StatsCompilation;
6446 toString(options?: any): string;
6447}
6448declare abstract class MultiWatching {
6449 watchings: Watching[];
6450 compiler: MultiCompiler;
6451 invalidate(callback?: any): void;
6452 suspend(): void;
6453 resume(): void;
6454 close(callback: CallbackFunction<void>): void;
6455}
6456declare class NamedChunkIdsPlugin {
6457 constructor(options?: any);
6458 delimiter: any;
6459 context: any;
6460
6461 /**
6462 * Apply the plugin
6463 */
6464 apply(compiler: Compiler): void;
6465}
6466declare class NamedModuleIdsPlugin {
6467 constructor(options?: any);
6468 options: any;
6469
6470 /**
6471 * Apply the plugin
6472 */
6473 apply(compiler: Compiler): void;
6474}
6475declare class NaturalModuleIdsPlugin {
6476 constructor();
6477
6478 /**
6479 * Apply the plugin
6480 */
6481 apply(compiler: Compiler): void;
6482}
6483declare interface NeedBuildContext {
6484 fileSystemInfo: FileSystemInfo;
6485 valueCacheVersions: Map<string, string>;
6486}
6487declare class NoEmitOnErrorsPlugin {
6488 constructor();
6489
6490 /**
6491 * Apply the plugin
6492 */
6493 apply(compiler: Compiler): void;
6494}
6495declare class NodeEnvironmentPlugin {
6496 constructor(options?: any);
6497 options: any;
6498
6499 /**
6500 * Apply the plugin
6501 */
6502 apply(compiler: Compiler): void;
6503}
6504type NodeEstreeIndex =
6505 | UnaryExpression
6506 | ThisExpression
6507 | ArrayExpression
6508 | ObjectExpression
6509 | FunctionExpression
6510 | ArrowFunctionExpression
6511 | YieldExpression
6512 | SimpleLiteral
6513 | RegExpLiteral
6514 | UpdateExpression
6515 | BinaryExpression
6516 | AssignmentExpression
6517 | LogicalExpression
6518 | MemberExpression
6519 | ConditionalExpression
6520 | SimpleCallExpression
6521 | NewExpression
6522 | SequenceExpression
6523 | TemplateLiteral
6524 | TaggedTemplateExpression
6525 | ClassExpression
6526 | MetaProperty
6527 | Identifier
6528 | AwaitExpression
6529 | ImportExpression
6530 | ChainExpression
6531 | FunctionDeclaration
6532 | VariableDeclaration
6533 | ClassDeclaration
6534 | ExpressionStatement
6535 | BlockStatement
6536 | EmptyStatement
6537 | DebuggerStatement
6538 | WithStatement
6539 | ReturnStatement
6540 | LabeledStatement
6541 | BreakStatement
6542 | ContinueStatement
6543 | IfStatement
6544 | SwitchStatement
6545 | ThrowStatement
6546 | TryStatement
6547 | WhileStatement
6548 | DoWhileStatement
6549 | ForStatement
6550 | ForInStatement
6551 | ForOfStatement
6552 | ImportDeclaration
6553 | ExportNamedDeclaration
6554 | ExportDefaultDeclaration
6555 | ExportAllDeclaration
6556 | MethodDefinition
6557 | VariableDeclarator
6558 | Program
6559 | Super
6560 | SwitchCase
6561 | CatchClause
6562 | Property
6563 | AssignmentProperty
6564 | TemplateElement
6565 | SpreadElement
6566 | ObjectPattern
6567 | ArrayPattern
6568 | RestElement
6569 | AssignmentPattern
6570 | ClassBody
6571 | ImportSpecifier
6572 | ImportDefaultSpecifier
6573 | ImportNamespaceSpecifier
6574 | ExportSpecifier;
6575
6576/**
6577 * Options object for node compatibility features.
6578 */
6579declare interface NodeOptions {
6580 /**
6581 * Include a polyfill for the '__dirname' variable.
6582 */
6583 __dirname?: boolean | "mock" | "eval-only";
6584
6585 /**
6586 * Include a polyfill for the '__filename' variable.
6587 */
6588 __filename?: boolean | "mock" | "eval-only";
6589
6590 /**
6591 * Include a polyfill for the 'global' variable.
6592 */
6593 global?: boolean;
6594}
6595declare class NodeSourcePlugin {
6596 constructor();
6597
6598 /**
6599 * Apply the plugin
6600 */
6601 apply(compiler: Compiler): void;
6602}
6603declare class NodeTargetPlugin {
6604 constructor();
6605
6606 /**
6607 * Apply the plugin
6608 */
6609 apply(compiler: Compiler): void;
6610}
6611declare class NodeTemplatePlugin {
6612 constructor(options?: any);
6613
6614 /**
6615 * Apply the plugin
6616 */
6617 apply(compiler: Compiler): void;
6618}
6619type NodeWebpackOptions = false | NodeOptions;
6620declare class NormalModule extends Module {
6621 constructor(__0: {
6622 /**
6623 * an optional layer in which the module is
6624 */
6625 layer?: string;
6626 /**
6627 * module type
6628 */
6629 type: string;
6630 /**
6631 * request string
6632 */
6633 request: string;
6634 /**
6635 * request intended by user (without loaders from config)
6636 */
6637 userRequest: string;
6638 /**
6639 * request without resolving
6640 */
6641 rawRequest: string;
6642 /**
6643 * list of loaders
6644 */
6645 loaders: LoaderItem[];
6646 /**
6647 * path + query of the real resource
6648 */
6649 resource: string;
6650 /**
6651 * path + query of the matched resource (virtual)
6652 */
6653 matchResource?: string;
6654 /**
6655 * the parser used
6656 */
6657 parser: Parser;
6658 /**
6659 * the options of the parser used
6660 */
6661 parserOptions: object;
6662 /**
6663 * the generator used
6664 */
6665 generator: Generator;
6666 /**
6667 * the options of the generator used
6668 */
6669 generatorOptions: object;
6670 /**
6671 * options used for resolving requests from this module
6672 */
6673 resolveOptions: Object;
6674 });
6675 request: string;
6676 userRequest: string;
6677 rawRequest: string;
6678 binary: boolean;
6679 parser: Parser;
6680 parserOptions: object;
6681 generator: Generator;
6682 generatorOptions: object;
6683 resource: string;
6684 matchResource?: string;
6685 loaders: LoaderItem[];
6686 error?: WebpackError;
6687 restoreFromUnsafeCache(
6688 unsafeCacheData?: any,
6689 normalModuleFactory?: any
6690 ): void;
6691 createSourceForAsset(
6692 context: string,
6693 name: string,
6694 content: string,
6695 sourceMap?: any,
6696 associatedObjectForCache?: Object
6697 ): Source;
6698 createLoaderContext(
6699 resolver: ResolverWithOptions,
6700 options: WebpackOptionsNormalized,
6701 compilation: Compilation,
6702 fs: InputFileSystem
6703 ): any;
6704 getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
6705 createSource(
6706 context: string,
6707 content: string | Buffer,
6708 sourceMap?: any,
6709 associatedObjectForCache?: Object
6710 ): Source;
6711 doBuild(
6712 options: WebpackOptionsNormalized,
6713 compilation: Compilation,
6714 resolver: ResolverWithOptions,
6715 fs: InputFileSystem,
6716 callback: (arg0?: WebpackError) => void
6717 ): void;
6718 markModuleAsErrored(error: WebpackError): void;
6719 applyNoParseRule(rule?: any, content?: any): any;
6720 shouldPreventParsing(noParseRule?: any, request?: any): any;
6721 static getCompilationHooks(
6722 compilation: Compilation
6723 ): NormalModuleCompilationHooks;
6724 static deserialize(context?: any): NormalModule;
6725}
6726declare interface NormalModuleCompilationHooks {
6727 loader: SyncHook<[object, NormalModule]>;
6728 beforeLoaders: SyncHook<[LoaderItem[], NormalModule, object]>;
6729 readResourceForScheme: HookMap<
6730 AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
6731 >;
6732}
6733declare abstract class NormalModuleFactory extends ModuleFactory {
6734 hooks: Readonly<{
6735 resolve: AsyncSeriesBailHook<[ResolveData], any>;
6736 resolveForScheme: HookMap<
6737 AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
6738 >;
6739 factorize: AsyncSeriesBailHook<[ResolveData], any>;
6740 beforeResolve: AsyncSeriesBailHook<[ResolveData], any>;
6741 afterResolve: AsyncSeriesBailHook<[ResolveData], any>;
6742 createModule: AsyncSeriesBailHook<[Object, ResolveData], any>;
6743 module: SyncWaterfallHook<[Module, Object, ResolveData], any>;
6744 createParser: HookMap<SyncBailHook<any, any>>;
6745 parser: HookMap<SyncHook<any>>;
6746 createGenerator: HookMap<SyncBailHook<any, any>>;
6747 generator: HookMap<SyncHook<any>>;
6748 }>;
6749 resolverFactory: ResolverFactory;
6750 ruleSet: RuleSet;
6751 unsafeCache: boolean;
6752 cachePredicate: Function;
6753 context: string;
6754 fs: InputFileSystem;
6755 parserCache: Map<string, WeakMap<Object, any>>;
6756 generatorCache: Map<string, WeakMap<Object, Generator>>;
6757 resolveResource(
6758 contextInfo?: any,
6759 context?: any,
6760 unresolvedResource?: any,
6761 resolver?: any,
6762 resolveContext?: any,
6763 callback?: any
6764 ): void;
6765 resolveRequestArray(
6766 contextInfo?: any,
6767 context?: any,
6768 array?: any,
6769 resolver?: any,
6770 resolveContext?: any,
6771 callback?: any
6772 ): any;
6773 getParser(type?: any, parserOptions?: object): any;
6774 createParser(type: string, parserOptions?: { [index: string]: any }): Parser;
6775 getGenerator(type?: any, generatorOptions?: object): undefined | Generator;
6776 createGenerator(type?: any, generatorOptions?: object): any;
6777 getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
6778}
6779declare class NormalModuleReplacementPlugin {
6780 /**
6781 * Create an instance of the plugin
6782 */
6783 constructor(
6784 resourceRegExp: RegExp,
6785 newResource: string | ((arg0?: any) => void)
6786 );
6787 resourceRegExp: RegExp;
6788 newResource: string | ((arg0?: any) => void);
6789
6790 /**
6791 * Apply the plugin
6792 */
6793 apply(compiler: Compiler): void;
6794}
6795type NormalizedStatsOptions = KnownNormalizedStatsOptions &
6796 Omit<
6797 StatsOptions,
6798 | "context"
6799 | "requestShortener"
6800 | "chunkGroups"
6801 | "chunksSort"
6802 | "modulesSort"
6803 | "chunkModulesSort"
6804 | "nestedModulesSort"
6805 | "assetsSort"
6806 | "ids"
6807 | "cachedAssets"
6808 | "groupAssetsByEmitStatus"
6809 | "groupAssetsByPath"
6810 | "groupAssetsByExtension"
6811 | "assetsSpace"
6812 | "excludeAssets"
6813 | "excludeModules"
6814 | "warningsFilter"
6815 | "cachedModules"
6816 | "orphanModules"
6817 | "dependentModules"
6818 | "runtimeModules"
6819 | "groupModulesByCacheStatus"
6820 | "groupModulesByLayer"
6821 | "groupModulesByAttributes"
6822 | "groupModulesByPath"
6823 | "groupModulesByExtension"
6824 | "groupModulesByType"
6825 | "entrypoints"
6826 | "chunkGroupAuxiliary"
6827 | "chunkGroupChildren"
6828 | "chunkGroupMaxAssets"
6829 | "modulesSpace"
6830 | "chunkModulesSpace"
6831 | "nestedModulesSpace"
6832 | "logging"
6833 | "loggingDebug"
6834 | "loggingTrace"
6835 | "_env"
6836 > &
6837 Record<string, any>;
6838declare class NullDependency extends Dependency {
6839 constructor();
6840 static Template: typeof NullDependencyTemplate;
6841 static NO_EXPORTS_REFERENCED: string[][];
6842 static EXPORTS_OBJECT_REFERENCED: string[][];
6843}
6844declare class NullDependencyTemplate extends DependencyTemplate {
6845 constructor();
6846}
6847declare interface ObjectDeserializerContext {
6848 read: () => any;
6849}
6850declare interface ObjectSerializer {
6851 serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
6852 deserialize: (arg0: ObjectDeserializerContext) => any;
6853}
6854declare interface ObjectSerializerContext {
6855 write: (arg0?: any) => void;
6856}
6857declare class OccurrenceChunkIdsPlugin {
6858 constructor(options?: OccurrenceChunkIdsPluginOptions);
6859 options: OccurrenceChunkIdsPluginOptions;
6860
6861 /**
6862 * Apply the plugin
6863 */
6864 apply(compiler: Compiler): void;
6865}
6866declare interface OccurrenceChunkIdsPluginOptions {
6867 /**
6868 * Prioritise initial size over total size.
6869 */
6870 prioritiseInitial?: boolean;
6871}
6872declare class OccurrenceModuleIdsPlugin {
6873 constructor(options?: OccurrenceModuleIdsPluginOptions);
6874 options: OccurrenceModuleIdsPluginOptions;
6875
6876 /**
6877 * Apply the plugin
6878 */
6879 apply(compiler: Compiler): void;
6880}
6881declare interface OccurrenceModuleIdsPluginOptions {
6882 /**
6883 * Prioritise initial size over total size.
6884 */
6885 prioritiseInitial?: boolean;
6886}
6887
6888/**
6889 * Enables/Disables integrated optimizations.
6890 */
6891declare interface Optimization {
6892 /**
6893 * Check for incompatible wasm types when importing/exporting from/to ESM.
6894 */
6895 checkWasmTypes?: boolean;
6896
6897 /**
6898 * 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).
6899 */
6900 chunkIds?:
6901 | false
6902 | "natural"
6903 | "named"
6904 | "deterministic"
6905 | "size"
6906 | "total-size";
6907
6908 /**
6909 * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
6910 */
6911 concatenateModules?: boolean;
6912
6913 /**
6914 * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
6915 */
6916 emitOnErrors?: boolean;
6917
6918 /**
6919 * Also flag chunks as loaded which contain a subset of the modules.
6920 */
6921 flagIncludedChunks?: boolean;
6922
6923 /**
6924 * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
6925 */
6926 innerGraph?: boolean;
6927
6928 /**
6929 * 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).
6930 */
6931 mangleExports?: boolean | "deterministic" | "size";
6932
6933 /**
6934 * Reduce size of WASM by changing imports to shorter strings.
6935 */
6936 mangleWasmImports?: boolean;
6937
6938 /**
6939 * Merge chunks which contain the same modules.
6940 */
6941 mergeDuplicateChunks?: boolean;
6942
6943 /**
6944 * Enable minimizing the output. Uses optimization.minimizer.
6945 */
6946 minimize?: boolean;
6947
6948 /**
6949 * Minimizer(s) to use for minimizing the output.
6950 */
6951 minimizer?: (
6952 | ((this: Compiler, compiler: Compiler) => void)
6953 | WebpackPluginInstance
6954 | "..."
6955 )[];
6956
6957 /**
6958 * 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).
6959 */
6960 moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
6961
6962 /**
6963 * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
6964 */
6965 noEmitOnErrors?: boolean;
6966
6967 /**
6968 * Set process.env.NODE_ENV to a specific value.
6969 */
6970 nodeEnv?: string | false;
6971
6972 /**
6973 * Generate records with relative paths to be able to move the context folder.
6974 */
6975 portableRecords?: boolean;
6976
6977 /**
6978 * Figure out which exports are provided by modules to generate more efficient code.
6979 */
6980 providedExports?: boolean;
6981
6982 /**
6983 * Use real [contenthash] based on final content of the assets.
6984 */
6985 realContentHash?: boolean;
6986
6987 /**
6988 * Removes modules from chunks when these modules are already included in all parents.
6989 */
6990 removeAvailableModules?: boolean;
6991
6992 /**
6993 * Remove chunks which are empty.
6994 */
6995 removeEmptyChunks?: boolean;
6996
6997 /**
6998 * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
6999 */
7000 runtimeChunk?:
7001 | boolean
7002 | "single"
7003 | "multiple"
7004 | {
7005 /**
7006 * The name or name factory for the runtime chunks.
7007 */
7008 name?: string | Function;
7009 };
7010
7011 /**
7012 * 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).
7013 */
7014 sideEffects?: boolean | "flag";
7015
7016 /**
7017 * Optimize duplication and caching by splitting chunks by shared modules and cache group.
7018 */
7019 splitChunks?: false | OptimizationSplitChunksOptions;
7020
7021 /**
7022 * 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).
7023 */
7024 usedExports?: boolean | "global";
7025}
7026
7027/**
7028 * Options object for describing behavior of a cache group selecting modules that should be cached together.
7029 */
7030declare interface OptimizationSplitChunksCacheGroup {
7031 /**
7032 * Sets the name delimiter for created chunks.
7033 */
7034 automaticNameDelimiter?: string;
7035
7036 /**
7037 * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
7038 */
7039 chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
7040
7041 /**
7042 * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
7043 */
7044 enforce?: boolean;
7045
7046 /**
7047 * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
7048 */
7049 enforceSizeThreshold?: number | { [index: string]: number };
7050
7051 /**
7052 * Sets the template for the filename for created chunks.
7053 */
7054 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7055
7056 /**
7057 * Sets the hint for chunk id.
7058 */
7059 idHint?: string;
7060
7061 /**
7062 * Assign modules to a cache group by module layer.
7063 */
7064 layer?: string | Function | RegExp;
7065
7066 /**
7067 * Maximum number of requests which are accepted for on-demand loading.
7068 */
7069 maxAsyncRequests?: number;
7070
7071 /**
7072 * Maximal size hint for the on-demand chunks.
7073 */
7074 maxAsyncSize?: number | { [index: string]: number };
7075
7076 /**
7077 * Maximum number of initial chunks which are accepted for an entry point.
7078 */
7079 maxInitialRequests?: number;
7080
7081 /**
7082 * Maximal size hint for the initial chunks.
7083 */
7084 maxInitialSize?: number | { [index: string]: number };
7085
7086 /**
7087 * Maximal size hint for the created chunks.
7088 */
7089 maxSize?: number | { [index: string]: number };
7090
7091 /**
7092 * Minimum number of times a module has to be duplicated until it's considered for splitting.
7093 */
7094 minChunks?: number;
7095
7096 /**
7097 * Minimal size for the chunks the stay after moving the modules to a new chunk.
7098 */
7099 minRemainingSize?: number | { [index: string]: number };
7100
7101 /**
7102 * Minimal size for the created chunk.
7103 */
7104 minSize?: number | { [index: string]: number };
7105
7106 /**
7107 * Give chunks for this cache group a name (chunks with equal name are merged).
7108 */
7109 name?: string | false | Function;
7110
7111 /**
7112 * Priority of this cache group.
7113 */
7114 priority?: number;
7115
7116 /**
7117 * Try to reuse existing chunk (with name) when it has matching modules.
7118 */
7119 reuseExistingChunk?: boolean;
7120
7121 /**
7122 * Assign modules to a cache group by module name.
7123 */
7124 test?: string | Function | RegExp;
7125
7126 /**
7127 * Assign modules to a cache group by module type.
7128 */
7129 type?: string | Function | RegExp;
7130
7131 /**
7132 * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
7133 */
7134 usedExports?: boolean;
7135}
7136
7137/**
7138 * Options object for splitting chunks into smaller chunks.
7139 */
7140declare interface OptimizationSplitChunksOptions {
7141 /**
7142 * Sets the name delimiter for created chunks.
7143 */
7144 automaticNameDelimiter?: string;
7145
7146 /**
7147 * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
7148 */
7149 cacheGroups?: {
7150 [index: string]:
7151 | string
7152 | false
7153 | Function
7154 | RegExp
7155 | OptimizationSplitChunksCacheGroup;
7156 };
7157
7158 /**
7159 * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
7160 */
7161 chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
7162
7163 /**
7164 * Sets the size types which are used when a number is used for sizes.
7165 */
7166 defaultSizeTypes?: string[];
7167
7168 /**
7169 * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
7170 */
7171 enforceSizeThreshold?: number | { [index: string]: number };
7172
7173 /**
7174 * Options for modules not selected by any other cache group.
7175 */
7176 fallbackCacheGroup?: {
7177 /**
7178 * Sets the name delimiter for created chunks.
7179 */
7180 automaticNameDelimiter?: string;
7181 /**
7182 * Maximal size hint for the on-demand chunks.
7183 */
7184 maxAsyncSize?: number | { [index: string]: number };
7185 /**
7186 * Maximal size hint for the initial chunks.
7187 */
7188 maxInitialSize?: number | { [index: string]: number };
7189 /**
7190 * Maximal size hint for the created chunks.
7191 */
7192 maxSize?: number | { [index: string]: number };
7193 /**
7194 * Minimal size for the created chunk.
7195 */
7196 minSize?: number | { [index: string]: number };
7197 };
7198
7199 /**
7200 * Sets the template for the filename for created chunks.
7201 */
7202 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7203
7204 /**
7205 * Prevents exposing path info when creating names for parts splitted by maxSize.
7206 */
7207 hidePathInfo?: boolean;
7208
7209 /**
7210 * Maximum number of requests which are accepted for on-demand loading.
7211 */
7212 maxAsyncRequests?: number;
7213
7214 /**
7215 * Maximal size hint for the on-demand chunks.
7216 */
7217 maxAsyncSize?: number | { [index: string]: number };
7218
7219 /**
7220 * Maximum number of initial chunks which are accepted for an entry point.
7221 */
7222 maxInitialRequests?: number;
7223
7224 /**
7225 * Maximal size hint for the initial chunks.
7226 */
7227 maxInitialSize?: number | { [index: string]: number };
7228
7229 /**
7230 * Maximal size hint for the created chunks.
7231 */
7232 maxSize?: number | { [index: string]: number };
7233
7234 /**
7235 * Minimum number of times a module has to be duplicated until it's considered for splitting.
7236 */
7237 minChunks?: number;
7238
7239 /**
7240 * Minimal size for the chunks the stay after moving the modules to a new chunk.
7241 */
7242 minRemainingSize?: number | { [index: string]: number };
7243
7244 /**
7245 * Minimal size for the created chunks.
7246 */
7247 minSize?: number | { [index: string]: number };
7248
7249 /**
7250 * Give chunks created a name (chunks with equal name are merged).
7251 */
7252 name?: string | false | Function;
7253
7254 /**
7255 * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
7256 */
7257 usedExports?: boolean;
7258}
7259declare abstract class OptionsApply {
7260 process(options?: any, compiler?: any): void;
7261}
7262declare interface OriginRecord {
7263 module: Module;
7264 loc: DependencyLocation;
7265 request: string;
7266}
7267declare class OriginalSource extends Source {
7268 constructor(source: string | Buffer, name: string);
7269 getName(): string;
7270}
7271
7272/**
7273 * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
7274 */
7275declare interface Output {
7276 /**
7277 * The filename of asset modules as relative path inside the 'output.path' directory.
7278 */
7279 assetModuleFilename?:
7280 | string
7281 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7282
7283 /**
7284 * Add a comment in the UMD wrapper.
7285 */
7286 auxiliaryComment?: string | LibraryCustomUmdCommentObject;
7287
7288 /**
7289 * Add charset attribute for script tag.
7290 */
7291 charset?: boolean;
7292
7293 /**
7294 * 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.
7295 */
7296 chunkFilename?:
7297 | string
7298 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7299
7300 /**
7301 * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
7302 */
7303 chunkFormat?: string | false;
7304
7305 /**
7306 * Number of milliseconds before chunk request expires.
7307 */
7308 chunkLoadTimeout?: number;
7309
7310 /**
7311 * 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).
7312 */
7313 chunkLoading?: string | false;
7314
7315 /**
7316 * The global variable used by webpack for loading of chunks.
7317 */
7318 chunkLoadingGlobal?: string;
7319
7320 /**
7321 * Clean the output directory before emit.
7322 */
7323 clean?: boolean | CleanOptions;
7324
7325 /**
7326 * Check if to be emitted file already exists and have the same content before writing to output filesystem.
7327 */
7328 compareBeforeEmit?: boolean;
7329
7330 /**
7331 * This option enables cross-origin loading of chunks.
7332 */
7333 crossOriginLoading?: false | "anonymous" | "use-credentials";
7334
7335 /**
7336 * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
7337 */
7338 devtoolFallbackModuleFilenameTemplate?: string | Function;
7339
7340 /**
7341 * Filename template string of function for the sources array in a generated SourceMap.
7342 */
7343 devtoolModuleFilenameTemplate?: string | Function;
7344
7345 /**
7346 * 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.
7347 */
7348 devtoolNamespace?: string;
7349
7350 /**
7351 * List of chunk loading types enabled for use by entry points.
7352 */
7353 enabledChunkLoadingTypes?: string[];
7354
7355 /**
7356 * List of library types enabled for use by entry points.
7357 */
7358 enabledLibraryTypes?: string[];
7359
7360 /**
7361 * List of wasm loading types enabled for use by entry points.
7362 */
7363 enabledWasmLoadingTypes?: string[];
7364
7365 /**
7366 * The abilities of the environment where the webpack generated code should run.
7367 */
7368 environment?: Environment;
7369
7370 /**
7371 * 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.
7372 */
7373 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7374
7375 /**
7376 * An expression which is used to address the global object/scope in runtime code.
7377 */
7378 globalObject?: string;
7379
7380 /**
7381 * Digest type used for the hash.
7382 */
7383 hashDigest?: string;
7384
7385 /**
7386 * Number of chars which are used for the hash.
7387 */
7388 hashDigestLength?: number;
7389
7390 /**
7391 * Algorithm used for generation the hash (see node.js crypto package).
7392 */
7393 hashFunction?: string | typeof Hash;
7394
7395 /**
7396 * Any string which is added to the hash to salt it.
7397 */
7398 hashSalt?: string;
7399
7400 /**
7401 * The filename of the Hot Update Chunks. They are inside the output.path directory.
7402 */
7403 hotUpdateChunkFilename?: string;
7404
7405 /**
7406 * The global variable used by webpack for loading of hot update chunks.
7407 */
7408 hotUpdateGlobal?: string;
7409
7410 /**
7411 * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
7412 */
7413 hotUpdateMainFilename?: string;
7414
7415 /**
7416 * Wrap javascript code into IIFE's to avoid leaking into global scope.
7417 */
7418 iife?: boolean;
7419
7420 /**
7421 * The name of the native import() function (can be exchanged for a polyfill).
7422 */
7423 importFunctionName?: string;
7424
7425 /**
7426 * The name of the native import.meta object (can be exchanged for a polyfill).
7427 */
7428 importMetaName?: string;
7429
7430 /**
7431 * Make the output files a library, exporting the exports of the entry point.
7432 */
7433 library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
7434
7435 /**
7436 * Specify which export should be exposed as library.
7437 */
7438 libraryExport?: string | string[];
7439
7440 /**
7441 * 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).
7442 */
7443 libraryTarget?: string;
7444
7445 /**
7446 * Output javascript files as module source type.
7447 */
7448 module?: boolean;
7449
7450 /**
7451 * The output directory as **absolute path** (required).
7452 */
7453 path?: string;
7454
7455 /**
7456 * Include comments with information about the modules.
7457 */
7458 pathinfo?: boolean | "verbose";
7459
7460 /**
7461 * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
7462 */
7463 publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7464
7465 /**
7466 * This option enables loading async chunks via a custom script type, such as script type="module".
7467 */
7468 scriptType?: false | "module" | "text/javascript";
7469
7470 /**
7471 * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
7472 */
7473 sourceMapFilename?: string;
7474
7475 /**
7476 * Prefixes every line of the source in the bundle with this string.
7477 */
7478 sourcePrefix?: string;
7479
7480 /**
7481 * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
7482 */
7483 strictModuleErrorHandling?: boolean;
7484
7485 /**
7486 * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
7487 */
7488 strictModuleExceptionHandling?: boolean;
7489
7490 /**
7491 * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
7492 */
7493 umdNamedDefine?: boolean;
7494
7495 /**
7496 * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
7497 */
7498 uniqueName?: string;
7499
7500 /**
7501 * 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).
7502 */
7503 wasmLoading?: string | false;
7504
7505 /**
7506 * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
7507 */
7508 webassemblyModuleFilename?: string;
7509
7510 /**
7511 * 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).
7512 */
7513 workerChunkLoading?: string | false;
7514
7515 /**
7516 * 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).
7517 */
7518 workerWasmLoading?: string | false;
7519}
7520declare interface OutputFileSystem {
7521 writeFile: (
7522 arg0: string,
7523 arg1: string | Buffer,
7524 arg2: (arg0?: NodeJS.ErrnoException) => void
7525 ) => void;
7526 mkdir: (arg0: string, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
7527 readdir?: (
7528 arg0: string,
7529 arg1: (
7530 arg0?: NodeJS.ErrnoException,
7531 arg1?: (string | Buffer)[] | IDirent[]
7532 ) => void
7533 ) => void;
7534 rmdir?: (arg0: string, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
7535 unlink?: (arg0: string, arg1: (arg0?: NodeJS.ErrnoException) => void) => void;
7536 stat: (
7537 arg0: string,
7538 arg1: (arg0?: NodeJS.ErrnoException, arg1?: IStats) => void
7539 ) => void;
7540 readFile: (
7541 arg0: string,
7542 arg1: (arg0?: NodeJS.ErrnoException, arg1?: string | Buffer) => void
7543 ) => void;
7544 join?: (arg0: string, arg1: string) => string;
7545 relative?: (arg0: string, arg1: string) => string;
7546 dirname?: (arg0: string) => string;
7547}
7548
7549/**
7550 * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
7551 */
7552declare interface OutputNormalized {
7553 /**
7554 * The filename of asset modules as relative path inside the 'output.path' directory.
7555 */
7556 assetModuleFilename?:
7557 | string
7558 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7559
7560 /**
7561 * Add charset attribute for script tag.
7562 */
7563 charset?: boolean;
7564
7565 /**
7566 * 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.
7567 */
7568 chunkFilename?:
7569 | string
7570 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7571
7572 /**
7573 * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
7574 */
7575 chunkFormat?: string | false;
7576
7577 /**
7578 * Number of milliseconds before chunk request expires.
7579 */
7580 chunkLoadTimeout?: number;
7581
7582 /**
7583 * 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).
7584 */
7585 chunkLoading?: string | false;
7586
7587 /**
7588 * The global variable used by webpack for loading of chunks.
7589 */
7590 chunkLoadingGlobal?: string;
7591
7592 /**
7593 * Clean the output directory before emit.
7594 */
7595 clean?: boolean | CleanOptions;
7596
7597 /**
7598 * Check if to be emitted file already exists and have the same content before writing to output filesystem.
7599 */
7600 compareBeforeEmit?: boolean;
7601
7602 /**
7603 * This option enables cross-origin loading of chunks.
7604 */
7605 crossOriginLoading?: false | "anonymous" | "use-credentials";
7606
7607 /**
7608 * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
7609 */
7610 devtoolFallbackModuleFilenameTemplate?: string | Function;
7611
7612 /**
7613 * Filename template string of function for the sources array in a generated SourceMap.
7614 */
7615 devtoolModuleFilenameTemplate?: string | Function;
7616
7617 /**
7618 * 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.
7619 */
7620 devtoolNamespace?: string;
7621
7622 /**
7623 * List of chunk loading types enabled for use by entry points.
7624 */
7625 enabledChunkLoadingTypes?: string[];
7626
7627 /**
7628 * List of library types enabled for use by entry points.
7629 */
7630 enabledLibraryTypes?: string[];
7631
7632 /**
7633 * List of wasm loading types enabled for use by entry points.
7634 */
7635 enabledWasmLoadingTypes?: string[];
7636
7637 /**
7638 * The abilities of the environment where the webpack generated code should run.
7639 */
7640 environment?: Environment;
7641
7642 /**
7643 * 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.
7644 */
7645 filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7646
7647 /**
7648 * An expression which is used to address the global object/scope in runtime code.
7649 */
7650 globalObject?: string;
7651
7652 /**
7653 * Digest type used for the hash.
7654 */
7655 hashDigest?: string;
7656
7657 /**
7658 * Number of chars which are used for the hash.
7659 */
7660 hashDigestLength?: number;
7661
7662 /**
7663 * Algorithm used for generation the hash (see node.js crypto package).
7664 */
7665 hashFunction?: string | typeof Hash;
7666
7667 /**
7668 * Any string which is added to the hash to salt it.
7669 */
7670 hashSalt?: string;
7671
7672 /**
7673 * The filename of the Hot Update Chunks. They are inside the output.path directory.
7674 */
7675 hotUpdateChunkFilename?: string;
7676
7677 /**
7678 * The global variable used by webpack for loading of hot update chunks.
7679 */
7680 hotUpdateGlobal?: string;
7681
7682 /**
7683 * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
7684 */
7685 hotUpdateMainFilename?: string;
7686
7687 /**
7688 * Wrap javascript code into IIFE's to avoid leaking into global scope.
7689 */
7690 iife?: boolean;
7691
7692 /**
7693 * The name of the native import() function (can be exchanged for a polyfill).
7694 */
7695 importFunctionName?: string;
7696
7697 /**
7698 * The name of the native import.meta object (can be exchanged for a polyfill).
7699 */
7700 importMetaName?: string;
7701
7702 /**
7703 * Options for library.
7704 */
7705 library?: LibraryOptions;
7706
7707 /**
7708 * Output javascript files as module source type.
7709 */
7710 module?: boolean;
7711
7712 /**
7713 * The output directory as **absolute path** (required).
7714 */
7715 path?: string;
7716
7717 /**
7718 * Include comments with information about the modules.
7719 */
7720 pathinfo?: boolean | "verbose";
7721
7722 /**
7723 * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
7724 */
7725 publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7726
7727 /**
7728 * This option enables loading async chunks via a custom script type, such as script type="module".
7729 */
7730 scriptType?: false | "module" | "text/javascript";
7731
7732 /**
7733 * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
7734 */
7735 sourceMapFilename?: string;
7736
7737 /**
7738 * Prefixes every line of the source in the bundle with this string.
7739 */
7740 sourcePrefix?: string;
7741
7742 /**
7743 * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
7744 */
7745 strictModuleErrorHandling?: boolean;
7746
7747 /**
7748 * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
7749 */
7750 strictModuleExceptionHandling?: boolean;
7751
7752 /**
7753 * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
7754 */
7755 uniqueName?: string;
7756
7757 /**
7758 * 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).
7759 */
7760 wasmLoading?: string | false;
7761
7762 /**
7763 * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
7764 */
7765 webassemblyModuleFilename?: string;
7766
7767 /**
7768 * 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).
7769 */
7770 workerChunkLoading?: string | false;
7771
7772 /**
7773 * 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).
7774 */
7775 workerWasmLoading?: string | false;
7776}
7777declare interface ParameterizedComparator<TArg, T> {
7778 (arg0: TArg): Comparator<T>;
7779}
7780declare interface ParsedIdentifier {
7781 request: string;
7782 query: string;
7783 fragment: string;
7784 directory: boolean;
7785 module: boolean;
7786 file: boolean;
7787 internal: boolean;
7788}
7789declare class Parser {
7790 constructor();
7791 parse(
7792 source: string | Buffer | PreparsedAst,
7793 state: ParserState
7794 ): ParserState;
7795}
7796type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
7797 ParserOptionsByModuleTypeUnknown;
7798
7799/**
7800 * Specify options for each parser.
7801 */
7802declare interface ParserOptionsByModuleTypeKnown {
7803 /**
7804 * Parser options for asset modules.
7805 */
7806 asset?: AssetParserOptions;
7807
7808 /**
7809 * No parser options are supported for this module type.
7810 */
7811 "asset/inline"?: EmptyParserOptions;
7812
7813 /**
7814 * No parser options are supported for this module type.
7815 */
7816 "asset/resource"?: EmptyParserOptions;
7817
7818 /**
7819 * No parser options are supported for this module type.
7820 */
7821 "asset/source"?: EmptyParserOptions;
7822
7823 /**
7824 * Parser options for javascript modules.
7825 */
7826 javascript?: JavascriptParserOptions;
7827
7828 /**
7829 * Parser options for javascript modules.
7830 */
7831 "javascript/auto"?: JavascriptParserOptions;
7832
7833 /**
7834 * Parser options for javascript modules.
7835 */
7836 "javascript/dynamic"?: JavascriptParserOptions;
7837
7838 /**
7839 * Parser options for javascript modules.
7840 */
7841 "javascript/esm"?: JavascriptParserOptions;
7842}
7843
7844/**
7845 * Specify options for each parser.
7846 */
7847declare interface ParserOptionsByModuleTypeUnknown {
7848 [index: string]: { [index: string]: any };
7849}
7850type ParserState = Record<string, any> & ParserStateBase;
7851declare interface ParserStateBase {
7852 current: NormalModule;
7853 module: NormalModule;
7854 compilation: Compilation;
7855 options: { [index: string]: any };
7856}
7857declare interface PathData {
7858 chunkGraph?: ChunkGraph;
7859 hash?: string;
7860 hashWithLength?: (arg0: number) => string;
7861 chunk?: Chunk | ChunkPathData;
7862 module?: Module | ModulePathData;
7863 runtime?: RuntimeSpec;
7864 filename?: string;
7865 basename?: string;
7866 query?: string;
7867 contentHashType?: string;
7868 contentHash?: string;
7869 contentHashWithLength?: (arg0: number) => string;
7870 noChunkHash?: boolean;
7871 url?: string;
7872}
7873
7874/**
7875 * Configuration object for web performance recommendations.
7876 */
7877declare interface PerformanceOptions {
7878 /**
7879 * Filter function to select assets that are checked.
7880 */
7881 assetFilter?: Function;
7882
7883 /**
7884 * Sets the format of the hints: warnings, errors or nothing at all.
7885 */
7886 hints?: false | "error" | "warning";
7887
7888 /**
7889 * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
7890 */
7891 maxAssetSize?: number;
7892
7893 /**
7894 * Total size of an entry point (in bytes).
7895 */
7896 maxEntrypointSize?: number;
7897}
7898type Plugin =
7899 | { apply: (arg0: Resolver) => void }
7900 | ((this: Resolver, arg1: Resolver) => void);
7901declare interface PnpApiImpl {
7902 resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string;
7903}
7904declare interface PossibleFileSystemError {
7905 code?: string;
7906 errno?: number;
7907 path?: string;
7908 syscall?: string;
7909}
7910declare class PrefetchPlugin {
7911 constructor(context?: any, request?: any);
7912 context: any;
7913 request: any;
7914
7915 /**
7916 * Apply the plugin
7917 */
7918 apply(compiler: Compiler): void;
7919}
7920declare class PrefixSource extends Source {
7921 constructor(prefix: string, source: string | Source);
7922 original(): Source;
7923 getPrefix(): string;
7924}
7925declare interface PreparsedAst {
7926 [index: string]: any;
7927}
7928declare interface PrintedElement {
7929 element: string;
7930 content: string;
7931}
7932declare interface Problem {
7933 type: ProblemType;
7934 path: string;
7935 argument: string;
7936 value?: any;
7937 index?: number;
7938 expected?: string;
7939}
7940type ProblemType =
7941 | "unknown-argument"
7942 | "unexpected-non-array-in-path"
7943 | "unexpected-non-object-in-path"
7944 | "multiple-values-unexpected"
7945 | "invalid-value";
7946declare interface ProcessAssetsAdditionalOptions {
7947 additionalAssets?: true | Function;
7948}
7949declare class Profiler {
7950 constructor(inspector?: any);
7951 session: any;
7952 inspector: any;
7953 hasSession(): boolean;
7954 startProfiling(): Promise<void> | Promise<[any, any, any]>;
7955 sendCommand(method?: any, params?: any): Promise<any>;
7956 destroy(): Promise<void>;
7957 stopProfiling(): Promise<{ profile: any }>;
7958}
7959declare class ProfilingPlugin {
7960 constructor(options?: ProfilingPluginOptions);
7961 outputPath: string;
7962 apply(compiler?: any): void;
7963 static Profiler: typeof Profiler;
7964}
7965declare interface ProfilingPluginOptions {
7966 /**
7967 * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
7968 */
7969 outputPath?: string;
7970}
7971declare class ProgressPlugin {
7972 constructor(options?: ProgressPluginArgument);
7973 profile?: null | boolean;
7974 handler?: (percentage: number, msg: string, ...args: string[]) => void;
7975 modulesCount?: number;
7976 dependenciesCount?: number;
7977 showEntries?: boolean;
7978 showModules?: boolean;
7979 showDependencies?: boolean;
7980 showActiveModules?: boolean;
7981 percentBy?: null | "dependencies" | "modules" | "entries";
7982 apply(compiler: Compiler | MultiCompiler): void;
7983 static getReporter(
7984 compiler: Compiler
7985 ): (p: number, ...args: string[]) => void;
7986 static defaultOptions: {
7987 profile: boolean;
7988 modulesCount: number;
7989 dependenciesCount: number;
7990 modules: boolean;
7991 dependencies: boolean;
7992 activeModules: boolean;
7993 entries: boolean;
7994 };
7995}
7996type ProgressPluginArgument =
7997 | ProgressPluginOptions
7998 | ((percentage: number, msg: string, ...args: string[]) => void);
7999
8000/**
8001 * Options object for the ProgressPlugin.
8002 */
8003declare interface ProgressPluginOptions {
8004 /**
8005 * Show active modules count and one active module in progress message.
8006 */
8007 activeModules?: boolean;
8008
8009 /**
8010 * Show dependencies count in progress message.
8011 */
8012 dependencies?: boolean;
8013
8014 /**
8015 * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
8016 */
8017 dependenciesCount?: number;
8018
8019 /**
8020 * Show entries count in progress message.
8021 */
8022 entries?: boolean;
8023
8024 /**
8025 * Function that executes for every progress step.
8026 */
8027 handler?: (percentage: number, msg: string, ...args: string[]) => void;
8028
8029 /**
8030 * Show modules count in progress message.
8031 */
8032 modules?: boolean;
8033
8034 /**
8035 * Minimum modules count to start with. For better progress calculation. Default: 5000.
8036 */
8037 modulesCount?: number;
8038
8039 /**
8040 * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
8041 */
8042 percentBy?: null | "dependencies" | "modules" | "entries";
8043
8044 /**
8045 * Collect profile data for progress steps. Default: false.
8046 */
8047 profile?: null | boolean;
8048}
8049declare class ProvidePlugin {
8050 constructor(definitions: Record<string, string | string[]>);
8051 definitions: Record<string, string | string[]>;
8052
8053 /**
8054 * Apply the plugin
8055 */
8056 apply(compiler: Compiler): void;
8057}
8058declare class ProvideSharedPlugin {
8059 constructor(options: ProvideSharedPluginOptions);
8060
8061 /**
8062 * Apply the plugin
8063 */
8064 apply(compiler: Compiler): void;
8065}
8066declare interface ProvideSharedPluginOptions {
8067 /**
8068 * 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.
8069 */
8070 provides: Provides;
8071
8072 /**
8073 * Share scope name used for all provided modules (defaults to 'default').
8074 */
8075 shareScope?: string;
8076}
8077type Provides = (string | ProvidesObject)[] | ProvidesObject;
8078
8079/**
8080 * Advanced configuration for modules that should be provided as shared modules to the share scope.
8081 */
8082declare interface ProvidesConfig {
8083 /**
8084 * 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.
8085 */
8086 eager?: boolean;
8087
8088 /**
8089 * Key in the share scope under which the shared modules should be stored.
8090 */
8091 shareKey?: string;
8092
8093 /**
8094 * Share scope name.
8095 */
8096 shareScope?: string;
8097
8098 /**
8099 * Version of the provided module. Will replace lower matching versions, but not higher.
8100 */
8101 version?: string | false;
8102}
8103
8104/**
8105 * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
8106 */
8107declare interface ProvidesObject {
8108 [index: string]: string | ProvidesConfig;
8109}
8110declare interface RawChunkGroupOptions {
8111 preloadOrder?: number;
8112 prefetchOrder?: number;
8113}
8114declare class RawSource extends Source {
8115 constructor(source: string | Buffer, convertToString?: boolean);
8116 isBuffer(): boolean;
8117}
8118declare class ReadFileCompileWasmPlugin {
8119 constructor(options?: any);
8120 options: any;
8121
8122 /**
8123 * Apply the plugin
8124 */
8125 apply(compiler: Compiler): void;
8126}
8127declare class RealContentHashPlugin {
8128 constructor(__0: { hashFunction: any; hashDigest: any });
8129
8130 /**
8131 * Apply the plugin
8132 */
8133 apply(compiler: Compiler): void;
8134 static getCompilationHooks(
8135 compilation: Compilation
8136 ): CompilationHooksRealContentHashPlugin;
8137}
8138declare interface RealDependencyLocation {
8139 start: SourcePosition;
8140 end?: SourcePosition;
8141 index?: number;
8142}
8143type RecursiveArrayOrRecord<T> =
8144 | { [index: string]: RecursiveArrayOrRecord<T> }
8145 | RecursiveArrayOrRecord<T>[]
8146 | T;
8147declare interface ReferencedExport {
8148 /**
8149 * name of the referenced export
8150 */
8151 name: string[];
8152
8153 /**
8154 * when false, referenced export can not be mangled, defaults to true
8155 */
8156 canMangle?: boolean;
8157}
8158type Remotes = (string | RemotesObject)[] | RemotesObject;
8159
8160/**
8161 * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
8162 */
8163declare interface RemotesConfig {
8164 /**
8165 * Container locations from which modules should be resolved and loaded at runtime.
8166 */
8167 external: string | string[];
8168
8169 /**
8170 * The name of the share scope shared with this remote.
8171 */
8172 shareScope?: string;
8173}
8174
8175/**
8176 * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
8177 */
8178declare interface RemotesObject {
8179 [index: string]: string | RemotesConfig | string[];
8180}
8181declare interface RenderBootstrapContext {
8182 /**
8183 * the chunk
8184 */
8185 chunk: Chunk;
8186
8187 /**
8188 * the runtime template
8189 */
8190 runtimeTemplate: RuntimeTemplate;
8191
8192 /**
8193 * the module graph
8194 */
8195 moduleGraph: ModuleGraph;
8196
8197 /**
8198 * the chunk graph
8199 */
8200 chunkGraph: ChunkGraph;
8201
8202 /**
8203 * hash to be used for render call
8204 */
8205 hash: string;
8206}
8207declare interface RenderContextModuleTemplate {
8208 /**
8209 * the chunk
8210 */
8211 chunk: Chunk;
8212
8213 /**
8214 * the dependency templates
8215 */
8216 dependencyTemplates: DependencyTemplates;
8217
8218 /**
8219 * the runtime template
8220 */
8221 runtimeTemplate: RuntimeTemplate;
8222
8223 /**
8224 * the module graph
8225 */
8226 moduleGraph: ModuleGraph;
8227
8228 /**
8229 * the chunk graph
8230 */
8231 chunkGraph: ChunkGraph;
8232}
8233declare interface RenderContextObject {
8234 /**
8235 * the chunk
8236 */
8237 chunk: Chunk;
8238
8239 /**
8240 * the dependency templates
8241 */
8242 dependencyTemplates: DependencyTemplates;
8243
8244 /**
8245 * the runtime template
8246 */
8247 runtimeTemplate: RuntimeTemplate;
8248
8249 /**
8250 * the module graph
8251 */
8252 moduleGraph: ModuleGraph;
8253
8254 /**
8255 * the chunk graph
8256 */
8257 chunkGraph: ChunkGraph;
8258
8259 /**
8260 * results of code generation
8261 */
8262 codeGenerationResults: CodeGenerationResults;
8263}
8264type RenderManifestEntry =
8265 | RenderManifestEntryTemplated
8266 | RenderManifestEntryStatic;
8267declare interface RenderManifestEntryStatic {
8268 render: () => Source;
8269 filename: string;
8270 info: AssetInfo;
8271 identifier: string;
8272 hash?: string;
8273 auxiliary?: boolean;
8274}
8275declare interface RenderManifestEntryTemplated {
8276 render: () => Source;
8277 filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
8278 pathOptions?: PathData;
8279 info?: AssetInfo;
8280 identifier: string;
8281 hash?: string;
8282 auxiliary?: boolean;
8283}
8284declare interface RenderManifestOptions {
8285 /**
8286 * the chunk used to render
8287 */
8288 chunk: Chunk;
8289 hash: string;
8290 fullHash: string;
8291 outputOptions: Output;
8292 codeGenerationResults: CodeGenerationResults;
8293 moduleTemplates: { javascript: ModuleTemplate };
8294 dependencyTemplates: DependencyTemplates;
8295 runtimeTemplate: RuntimeTemplate;
8296 moduleGraph: ModuleGraph;
8297 chunkGraph: ChunkGraph;
8298}
8299declare class ReplaceSource extends Source {
8300 constructor(source: Source, name?: string);
8301 replace(start: number, end: number, newValue: string, name?: string): void;
8302 insert(pos: number, newValue: string, name?: string): void;
8303 getName(): string;
8304 original(): string;
8305 getReplacements(): {
8306 start: number;
8307 end: number;
8308 content: string;
8309 insertIndex: number;
8310 name: string;
8311 }[];
8312}
8313declare abstract class RequestShortener {
8314 contextify: (arg0: string) => string;
8315 shorten(request?: null | string): undefined | null | string;
8316}
8317declare interface ResolveBuildDependenciesResult {
8318 /**
8319 * list of files
8320 */
8321 files: Set<string>;
8322
8323 /**
8324 * list of directories
8325 */
8326 directories: Set<string>;
8327
8328 /**
8329 * list of missing entries
8330 */
8331 missing: Set<string>;
8332
8333 /**
8334 * stored resolve results
8335 */
8336 resolveResults: Map<string, string>;
8337
8338 /**
8339 * dependencies of the resolving
8340 */
8341 resolveDependencies: {
8342 /**
8343 * list of files
8344 */
8345 files: Set<string>;
8346 /**
8347 * list of directories
8348 */
8349 directories: Set<string>;
8350 /**
8351 * list of missing entries
8352 */
8353 missing: Set<string>;
8354 };
8355}
8356
8357/**
8358 * Resolve context
8359 */
8360declare interface ResolveContext {
8361 contextDependencies?: WriteOnlySet<string>;
8362
8363 /**
8364 * files that was found on file system
8365 */
8366 fileDependencies?: WriteOnlySet<string>;
8367
8368 /**
8369 * dependencies that was not found on file system
8370 */
8371 missingDependencies?: WriteOnlySet<string>;
8372
8373 /**
8374 * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
8375 */
8376 stack?: Set<string>;
8377
8378 /**
8379 * log function
8380 */
8381 log?: (arg0: string) => void;
8382}
8383declare interface ResolveData {
8384 contextInfo: ModuleFactoryCreateDataContextInfo;
8385 resolveOptions?: ResolveOptionsWebpackOptions;
8386 context: string;
8387 request: string;
8388 dependencies: ModuleDependency[];
8389 createData: Object;
8390 fileDependencies: LazySet<string>;
8391 missingDependencies: LazySet<string>;
8392 contextDependencies: LazySet<string>;
8393
8394 /**
8395 * allow to use the unsafe cache
8396 */
8397 cacheable: boolean;
8398}
8399declare interface ResolveOptionsTypes {
8400 alias: AliasOption[];
8401 fallback: AliasOption[];
8402 aliasFields: Set<string | string[]>;
8403 cachePredicate: (arg0: ResolveRequest) => boolean;
8404 cacheWithContext: boolean;
8405
8406 /**
8407 * A list of exports field condition names.
8408 */
8409 conditionNames: Set<string>;
8410 descriptionFiles: string[];
8411 enforceExtension: boolean;
8412 exportsFields: Set<string | string[]>;
8413 importsFields: Set<string | string[]>;
8414 extensions: Set<string>;
8415 fileSystem: FileSystem;
8416 unsafeCache: false | object;
8417 symlinks: boolean;
8418 resolver?: Resolver;
8419 modules: (string | string[])[];
8420 mainFields: { name: string[]; forceRelative: boolean }[];
8421 mainFiles: Set<string>;
8422 plugins: Plugin[];
8423 pnpApi: null | PnpApiImpl;
8424 roots: Set<string>;
8425 fullySpecified: boolean;
8426 resolveToContext: boolean;
8427 restrictions: Set<string | RegExp>;
8428 preferRelative: boolean;
8429 preferAbsolute: boolean;
8430}
8431
8432/**
8433 * Options object for resolving requests.
8434 */
8435declare interface ResolveOptionsWebpackOptions {
8436 /**
8437 * Redirect module requests.
8438 */
8439 alias?:
8440 | {
8441 /**
8442 * New request.
8443 */
8444 alias: string | false | string[];
8445 /**
8446 * Request to be redirected.
8447 */
8448 name: string;
8449 /**
8450 * Redirect only exact matching request.
8451 */
8452 onlyModule?: boolean;
8453 }[]
8454 | { [index: string]: string | false | string[] };
8455
8456 /**
8457 * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
8458 */
8459 aliasFields?: (string | string[])[];
8460
8461 /**
8462 * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
8463 */
8464 byDependency?: { [index: string]: ResolveOptionsWebpackOptions };
8465
8466 /**
8467 * Enable caching of successfully resolved requests (cache entries are revalidated).
8468 */
8469 cache?: boolean;
8470
8471 /**
8472 * Predicate function to decide which requests should be cached.
8473 */
8474 cachePredicate?: (request: ResolveRequest) => boolean;
8475
8476 /**
8477 * Include the context information in the cache identifier when caching.
8478 */
8479 cacheWithContext?: boolean;
8480
8481 /**
8482 * Condition names for exports field entry point.
8483 */
8484 conditionNames?: string[];
8485
8486 /**
8487 * Filenames used to find a description file (like a package.json).
8488 */
8489 descriptionFiles?: string[];
8490
8491 /**
8492 * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
8493 */
8494 enforceExtension?: boolean;
8495
8496 /**
8497 * Field names from the description file (usually package.json) which are used to provide entry points of a package.
8498 */
8499 exportsFields?: string[];
8500
8501 /**
8502 * Extensions added to the request when trying to find the file.
8503 */
8504 extensions?: string[];
8505
8506 /**
8507 * Redirect module requests when normal resolving fails.
8508 */
8509 fallback?:
8510 | {
8511 /**
8512 * New request.
8513 */
8514 alias: string | false | string[];
8515 /**
8516 * Request to be redirected.
8517 */
8518 name: string;
8519 /**
8520 * Redirect only exact matching request.
8521 */
8522 onlyModule?: boolean;
8523 }[]
8524 | { [index: string]: string | false | string[] };
8525
8526 /**
8527 * Filesystem for the resolver.
8528 */
8529 fileSystem?: InputFileSystem;
8530
8531 /**
8532 * 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).
8533 */
8534 fullySpecified?: boolean;
8535
8536 /**
8537 * 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).
8538 */
8539 importsFields?: string[];
8540
8541 /**
8542 * Field names from the description file (package.json) which are used to find the default entry point.
8543 */
8544 mainFields?: (string | string[])[];
8545
8546 /**
8547 * Filenames used to find the default entry point if there is no description file or main field.
8548 */
8549 mainFiles?: string[];
8550
8551 /**
8552 * Folder names or directory paths where to find modules.
8553 */
8554 modules?: string[];
8555
8556 /**
8557 * Plugins for the resolver.
8558 */
8559 plugins?: ("..." | ResolvePluginInstance)[];
8560
8561 /**
8562 * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
8563 */
8564 preferAbsolute?: boolean;
8565
8566 /**
8567 * Prefer to resolve module requests as relative request and fallback to resolving as module.
8568 */
8569 preferRelative?: boolean;
8570
8571 /**
8572 * Custom resolver.
8573 */
8574 resolver?: Resolver;
8575
8576 /**
8577 * 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.
8578 */
8579 restrictions?: (string | RegExp)[];
8580
8581 /**
8582 * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
8583 */
8584 roots?: string[];
8585
8586 /**
8587 * Enable resolving symlinks to the original location.
8588 */
8589 symlinks?: boolean;
8590
8591 /**
8592 * Enable caching of successfully resolved requests (cache entries are not revalidated).
8593 */
8594 unsafeCache?: boolean | { [index: string]: any };
8595
8596 /**
8597 * Use synchronous filesystem calls for the resolver.
8598 */
8599 useSyncFileSystemCalls?: boolean;
8600}
8601type ResolveOptionsWithDependencyType = ResolveOptionsWebpackOptions & {
8602 dependencyType?: string;
8603 resolveToContext?: boolean;
8604};
8605
8606/**
8607 * Plugin instance.
8608 */
8609declare interface ResolvePluginInstance {
8610 [index: string]: any;
8611
8612 /**
8613 * The run point of the plugin, required method.
8614 */
8615 apply: (resolver: Resolver) => void;
8616}
8617type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
8618declare abstract class Resolver {
8619 fileSystem: FileSystem;
8620 options: ResolveOptionsTypes;
8621 hooks: {
8622 resolveStep: SyncHook<
8623 [
8624 AsyncSeriesBailHook<
8625 [ResolveRequest, ResolveContext],
8626 null | ResolveRequest
8627 >,
8628 ResolveRequest
8629 ]
8630 >;
8631 noResolve: SyncHook<[ResolveRequest, Error]>;
8632 resolve: AsyncSeriesBailHook<
8633 [ResolveRequest, ResolveContext],
8634 null | ResolveRequest
8635 >;
8636 result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
8637 };
8638 ensureHook(
8639 name:
8640 | string
8641 | AsyncSeriesBailHook<
8642 [ResolveRequest, ResolveContext],
8643 null | ResolveRequest
8644 >
8645 ): AsyncSeriesBailHook<
8646 [ResolveRequest, ResolveContext],
8647 null | ResolveRequest
8648 >;
8649 getHook(
8650 name:
8651 | string
8652 | AsyncSeriesBailHook<
8653 [ResolveRequest, ResolveContext],
8654 null | ResolveRequest
8655 >
8656 ): AsyncSeriesBailHook<
8657 [ResolveRequest, ResolveContext],
8658 null | ResolveRequest
8659 >;
8660 resolveSync(context: object, path: string, request: string): string | false;
8661 resolve(
8662 context: object,
8663 path: string,
8664 request: string,
8665 resolveContext: ResolveContext,
8666 callback: (
8667 arg0: null | Error,
8668 arg1?: string | false,
8669 arg2?: ResolveRequest
8670 ) => void
8671 ): void;
8672 doResolve(
8673 hook?: any,
8674 request?: any,
8675 message?: any,
8676 resolveContext?: any,
8677 callback?: any
8678 ): any;
8679 parse(identifier: string): ParsedIdentifier;
8680 isModule(path?: any): boolean;
8681 isPrivate(path?: any): boolean;
8682 isDirectory(path: string): boolean;
8683 join(path?: any, request?: any): string;
8684 normalize(path?: any): string;
8685}
8686declare interface ResolverCache {
8687 direct: WeakMap<Object, ResolverWithOptions>;
8688 stringified: Map<string, ResolverWithOptions>;
8689}
8690declare abstract class ResolverFactory {
8691 hooks: Readonly<{
8692 resolveOptions: HookMap<
8693 SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
8694 >;
8695 resolver: HookMap<
8696 SyncHook<[Resolver, UserResolveOptions, ResolveOptionsWithDependencyType]>
8697 >;
8698 }>;
8699 cache: Map<string, ResolverCache>;
8700 get(
8701 type: string,
8702 resolveOptions?: ResolveOptionsWithDependencyType
8703 ): ResolverWithOptions;
8704}
8705type ResolverWithOptions = Resolver & WithOptions;
8706
8707declare interface ResourceDataWithData {
8708 resource: string;
8709 path: string;
8710 query: string;
8711 fragment: string;
8712 data: Record<string, any>;
8713}
8714type Rule = string | RegExp;
8715declare interface RuleSet {
8716 /**
8717 * map of references in the rule set (may grow over time)
8718 */
8719 references: Map<string, any>;
8720
8721 /**
8722 * execute the rule set
8723 */
8724 exec: (arg0: object) => Effect[];
8725}
8726type RuleSetCondition =
8727 | string
8728 | RegExp
8729 | {
8730 /**
8731 * Logical AND.
8732 */
8733 and?: RuleSetCondition[];
8734 /**
8735 * Logical NOT.
8736 */
8737 not?: RuleSetCondition[];
8738 /**
8739 * Logical OR.
8740 */
8741 or?: RuleSetCondition[];
8742 }
8743 | ((value: string) => boolean)
8744 | RuleSetCondition[];
8745type RuleSetConditionAbsolute =
8746 | string
8747 | RegExp
8748 | {
8749 /**
8750 * Logical AND.
8751 */
8752 and?: RuleSetConditionAbsolute[];
8753 /**
8754 * Logical NOT.
8755 */
8756 not?: RuleSetConditionAbsolute[];
8757 /**
8758 * Logical OR.
8759 */
8760 or?: RuleSetConditionAbsolute[];
8761 }
8762 | ((value: string) => boolean)
8763 | RuleSetConditionAbsolute[];
8764type RuleSetConditionOrConditions =
8765 | string
8766 | RegExp
8767 | {
8768 /**
8769 * Logical AND.
8770 */
8771 and?: RuleSetCondition[];
8772 /**
8773 * Logical NOT.
8774 */
8775 not?: RuleSetCondition[];
8776 /**
8777 * Logical OR.
8778 */
8779 or?: RuleSetCondition[];
8780 }
8781 | ((value: string) => boolean)
8782 | RuleSetCondition[];
8783
8784/**
8785 * A rule description with conditions and effects for modules.
8786 */
8787declare interface RuleSetRule {
8788 /**
8789 * Match the child compiler name.
8790 */
8791 compiler?:
8792 | string
8793 | RegExp
8794 | {
8795 /**
8796 * Logical AND.
8797 */
8798 and?: RuleSetCondition[];
8799 /**
8800 * Logical NOT.
8801 */
8802 not?: RuleSetCondition[];
8803 /**
8804 * Logical OR.
8805 */
8806 or?: RuleSetCondition[];
8807 }
8808 | ((value: string) => boolean)
8809 | RuleSetCondition[];
8810
8811 /**
8812 * Match dependency type.
8813 */
8814 dependency?:
8815 | string
8816 | RegExp
8817 | {
8818 /**
8819 * Logical AND.
8820 */
8821 and?: RuleSetCondition[];
8822 /**
8823 * Logical NOT.
8824 */
8825 not?: RuleSetCondition[];
8826 /**
8827 * Logical OR.
8828 */
8829 or?: RuleSetCondition[];
8830 }
8831 | ((value: string) => boolean)
8832 | RuleSetCondition[];
8833
8834 /**
8835 * Match values of properties in the description file (usually package.json).
8836 */
8837 descriptionData?: { [index: string]: RuleSetConditionOrConditions };
8838
8839 /**
8840 * Enforce this rule as pre or post step.
8841 */
8842 enforce?: "pre" | "post";
8843
8844 /**
8845 * Shortcut for resource.exclude.
8846 */
8847 exclude?:
8848 | string
8849 | RegExp
8850 | {
8851 /**
8852 * Logical AND.
8853 */
8854 and?: RuleSetConditionAbsolute[];
8855 /**
8856 * Logical NOT.
8857 */
8858 not?: RuleSetConditionAbsolute[];
8859 /**
8860 * Logical OR.
8861 */
8862 or?: RuleSetConditionAbsolute[];
8863 }
8864 | ((value: string) => boolean)
8865 | RuleSetConditionAbsolute[];
8866
8867 /**
8868 * The options for the module generator.
8869 */
8870 generator?: { [index: string]: any };
8871
8872 /**
8873 * Shortcut for resource.include.
8874 */
8875 include?:
8876 | string
8877 | RegExp
8878 | {
8879 /**
8880 * Logical AND.
8881 */
8882 and?: RuleSetConditionAbsolute[];
8883 /**
8884 * Logical NOT.
8885 */
8886 not?: RuleSetConditionAbsolute[];
8887 /**
8888 * Logical OR.
8889 */
8890 or?: RuleSetConditionAbsolute[];
8891 }
8892 | ((value: string) => boolean)
8893 | RuleSetConditionAbsolute[];
8894
8895 /**
8896 * Match the issuer of the module (The module pointing to this module).
8897 */
8898 issuer?:
8899 | string
8900 | RegExp
8901 | {
8902 /**
8903 * Logical AND.
8904 */
8905 and?: RuleSetConditionAbsolute[];
8906 /**
8907 * Logical NOT.
8908 */
8909 not?: RuleSetConditionAbsolute[];
8910 /**
8911 * Logical OR.
8912 */
8913 or?: RuleSetConditionAbsolute[];
8914 }
8915 | ((value: string) => boolean)
8916 | RuleSetConditionAbsolute[];
8917
8918 /**
8919 * Match layer of the issuer of this module (The module pointing to this module).
8920 */
8921 issuerLayer?:
8922 | string
8923 | RegExp
8924 | {
8925 /**
8926 * Logical AND.
8927 */
8928 and?: RuleSetCondition[];
8929 /**
8930 * Logical NOT.
8931 */
8932 not?: RuleSetCondition[];
8933 /**
8934 * Logical OR.
8935 */
8936 or?: RuleSetCondition[];
8937 }
8938 | ((value: string) => boolean)
8939 | RuleSetCondition[];
8940
8941 /**
8942 * Specifies the layer in which the module should be placed in.
8943 */
8944 layer?: string;
8945
8946 /**
8947 * Shortcut for use.loader.
8948 */
8949 loader?: string;
8950
8951 /**
8952 * Match module mimetype when load from Data URI.
8953 */
8954 mimetype?:
8955 | string
8956 | RegExp
8957 | {
8958 /**
8959 * Logical AND.
8960 */
8961 and?: RuleSetCondition[];
8962 /**
8963 * Logical NOT.
8964 */
8965 not?: RuleSetCondition[];
8966 /**
8967 * Logical OR.
8968 */
8969 or?: RuleSetCondition[];
8970 }
8971 | ((value: string) => boolean)
8972 | RuleSetCondition[];
8973
8974 /**
8975 * Only execute the first matching rule in this array.
8976 */
8977 oneOf?: RuleSetRule[];
8978
8979 /**
8980 * Shortcut for use.options.
8981 */
8982 options?: string | { [index: string]: any };
8983
8984 /**
8985 * Options for parsing.
8986 */
8987 parser?: { [index: string]: any };
8988
8989 /**
8990 * Match the real resource path of the module.
8991 */
8992 realResource?:
8993 | string
8994 | RegExp
8995 | {
8996 /**
8997 * Logical AND.
8998 */
8999 and?: RuleSetConditionAbsolute[];
9000 /**
9001 * Logical NOT.
9002 */
9003 not?: RuleSetConditionAbsolute[];
9004 /**
9005 * Logical OR.
9006 */
9007 or?: RuleSetConditionAbsolute[];
9008 }
9009 | ((value: string) => boolean)
9010 | RuleSetConditionAbsolute[];
9011
9012 /**
9013 * Options for the resolver.
9014 */
9015 resolve?: ResolveOptionsWebpackOptions;
9016
9017 /**
9018 * Match the resource path of the module.
9019 */
9020 resource?:
9021 | string
9022 | RegExp
9023 | {
9024 /**
9025 * Logical AND.
9026 */
9027 and?: RuleSetConditionAbsolute[];
9028 /**
9029 * Logical NOT.
9030 */
9031 not?: RuleSetConditionAbsolute[];
9032 /**
9033 * Logical OR.
9034 */
9035 or?: RuleSetConditionAbsolute[];
9036 }
9037 | ((value: string) => boolean)
9038 | RuleSetConditionAbsolute[];
9039
9040 /**
9041 * Match the resource fragment of the module.
9042 */
9043 resourceFragment?:
9044 | string
9045 | RegExp
9046 | {
9047 /**
9048 * Logical AND.
9049 */
9050 and?: RuleSetCondition[];
9051 /**
9052 * Logical NOT.
9053 */
9054 not?: RuleSetCondition[];
9055 /**
9056 * Logical OR.
9057 */
9058 or?: RuleSetCondition[];
9059 }
9060 | ((value: string) => boolean)
9061 | RuleSetCondition[];
9062
9063 /**
9064 * Match the resource query of the module.
9065 */
9066 resourceQuery?:
9067 | string
9068 | RegExp
9069 | {
9070 /**
9071 * Logical AND.
9072 */
9073 and?: RuleSetCondition[];
9074 /**
9075 * Logical NOT.
9076 */
9077 not?: RuleSetCondition[];
9078 /**
9079 * Logical OR.
9080 */
9081 or?: RuleSetCondition[];
9082 }
9083 | ((value: string) => boolean)
9084 | RuleSetCondition[];
9085
9086 /**
9087 * Match and execute these rules when this rule is matched.
9088 */
9089 rules?: RuleSetRule[];
9090
9091 /**
9092 * Flags a module as with or without side effects.
9093 */
9094 sideEffects?: boolean;
9095
9096 /**
9097 * Shortcut for resource.test.
9098 */
9099 test?:
9100 | string
9101 | RegExp
9102 | {
9103 /**
9104 * Logical AND.
9105 */
9106 and?: RuleSetConditionAbsolute[];
9107 /**
9108 * Logical NOT.
9109 */
9110 not?: RuleSetConditionAbsolute[];
9111 /**
9112 * Logical OR.
9113 */
9114 or?: RuleSetConditionAbsolute[];
9115 }
9116 | ((value: string) => boolean)
9117 | RuleSetConditionAbsolute[];
9118
9119 /**
9120 * Module type to use for the module.
9121 */
9122 type?: string;
9123
9124 /**
9125 * Modifiers applied to the module when rule is matched.
9126 */
9127 use?:
9128 | string
9129 | RuleSetUseItem[]
9130 | ((data: {
9131 resource: string;
9132 realResource: string;
9133 resourceQuery: string;
9134 issuer: string;
9135 compiler: string;
9136 }) => RuleSetUseItem[])
9137 | {
9138 /**
9139 * Unique loader options identifier.
9140 */
9141 ident?: string;
9142 /**
9143 * Loader name.
9144 */
9145 loader?: string;
9146 /**
9147 * Loader options.
9148 */
9149 options?: string | { [index: string]: any };
9150 }
9151 | ((
9152 data: object
9153 ) =>
9154 | string
9155 | {
9156 /**
9157 * Unique loader options identifier.
9158 */
9159 ident?: string;
9160 /**
9161 * Loader name.
9162 */
9163 loader?: string;
9164 /**
9165 * Loader options.
9166 */
9167 options?: string | { [index: string]: any };
9168 }
9169 | __TypeWebpackOptions
9170 | RuleSetUseItem[]);
9171}
9172type RuleSetUse =
9173 | string
9174 | RuleSetUseItem[]
9175 | ((data: {
9176 resource: string;
9177 realResource: string;
9178 resourceQuery: string;
9179 issuer: string;
9180 compiler: string;
9181 }) => RuleSetUseItem[])
9182 | {
9183 /**
9184 * Unique loader options identifier.
9185 */
9186 ident?: string;
9187 /**
9188 * Loader name.
9189 */
9190 loader?: string;
9191 /**
9192 * Loader options.
9193 */
9194 options?: string | { [index: string]: any };
9195 }
9196 | __TypeWebpackOptions;
9197type RuleSetUseItem =
9198 | string
9199 | {
9200 /**
9201 * Unique loader options identifier.
9202 */
9203 ident?: string;
9204 /**
9205 * Loader name.
9206 */
9207 loader?: string;
9208 /**
9209 * Loader options.
9210 */
9211 options?: string | { [index: string]: any };
9212 }
9213 | __TypeWebpackOptions;
9214declare class RuntimeChunkPlugin {
9215 constructor(options?: any);
9216 options: any;
9217
9218 /**
9219 * Apply the plugin
9220 */
9221 apply(compiler: Compiler): void;
9222}
9223declare class RuntimeModule extends Module {
9224 constructor(name: string, stage?: number);
9225 name: string;
9226 stage: number;
9227 compilation: Compilation;
9228 chunk: Chunk;
9229 fullHash: boolean;
9230 attach(compilation: Compilation, chunk: Chunk): void;
9231 generate(): string;
9232 getGeneratedCode(): string;
9233 shouldIsolate(): boolean;
9234
9235 /**
9236 * Runtime modules without any dependencies to other runtime modules
9237 */
9238 static STAGE_NORMAL: number;
9239
9240 /**
9241 * Runtime modules with simple dependencies on other runtime modules
9242 */
9243 static STAGE_BASIC: number;
9244
9245 /**
9246 * Runtime modules which attach to handlers of other runtime modules
9247 */
9248 static STAGE_ATTACH: number;
9249
9250 /**
9251 * Runtime modules which trigger actions on bootstrap
9252 */
9253 static STAGE_TRIGGER: number;
9254}
9255type RuntimeSpec = undefined | string | SortableSet<string>;
9256declare abstract class RuntimeSpecMap<T> {
9257 get(runtime: RuntimeSpec): T;
9258 has(runtime: RuntimeSpec): boolean;
9259 set(runtime?: any, value?: any): void;
9260 provide(runtime?: any, computer?: any): any;
9261 delete(runtime?: any): void;
9262 update(runtime?: any, fn?: any): void;
9263 keys(): RuntimeSpec[];
9264 values(): IterableIterator<T>;
9265 readonly size?: number;
9266}
9267declare abstract class RuntimeSpecSet {
9268 add(runtime?: any): void;
9269 has(runtime?: any): boolean;
9270 [Symbol.iterator](): IterableIterator<RuntimeSpec>;
9271 readonly size: number;
9272}
9273declare abstract class RuntimeTemplate {
9274 compilation: Compilation;
9275 outputOptions: OutputNormalized;
9276 requestShortener: RequestShortener;
9277 isIIFE(): undefined | boolean;
9278 isModule(): undefined | boolean;
9279 supportsConst(): undefined | boolean;
9280 supportsArrowFunction(): undefined | boolean;
9281 supportsForOf(): undefined | boolean;
9282 supportsDestructuring(): undefined | boolean;
9283 supportsBigIntLiteral(): undefined | boolean;
9284 supportsDynamicImport(): undefined | boolean;
9285 supportsEcmaScriptModuleSyntax(): undefined | boolean;
9286 supportTemplateLiteral(): boolean;
9287 returningFunction(returnValue?: any, args?: string): string;
9288 basicFunction(args?: any, body?: any): string;
9289 expressionFunction(expression?: any, args?: string): string;
9290 emptyFunction(): "x => {}" | "function() {}";
9291 destructureArray(items?: any, value?: any): string;
9292 iife(args?: any, body?: any): string;
9293 forEach(variable?: any, array?: any, body?: any): string;
9294
9295 /**
9296 * Add a comment
9297 */
9298 comment(__0: {
9299 /**
9300 * request string used originally
9301 */
9302 request?: string;
9303 /**
9304 * name of the chunk referenced
9305 */
9306 chunkName?: string;
9307 /**
9308 * reason information of the chunk
9309 */
9310 chunkReason?: string;
9311 /**
9312 * additional message
9313 */
9314 message?: string;
9315 /**
9316 * name of the export
9317 */
9318 exportName?: string;
9319 }): string;
9320 throwMissingModuleErrorBlock(__0: {
9321 /**
9322 * request string used originally
9323 */
9324 request?: string;
9325 }): string;
9326 throwMissingModuleErrorFunction(__0: {
9327 /**
9328 * request string used originally
9329 */
9330 request?: string;
9331 }): string;
9332 missingModule(__0: {
9333 /**
9334 * request string used originally
9335 */
9336 request?: string;
9337 }): string;
9338 missingModuleStatement(__0: {
9339 /**
9340 * request string used originally
9341 */
9342 request?: string;
9343 }): string;
9344 missingModulePromise(__0: {
9345 /**
9346 * request string used originally
9347 */
9348 request?: string;
9349 }): string;
9350 weakError(__0: {
9351 /**
9352 * the chunk graph
9353 */
9354 chunkGraph: ChunkGraph;
9355 /**
9356 * the module
9357 */
9358 module: Module;
9359 /**
9360 * the request that should be printed as comment
9361 */
9362 request: string;
9363 /**
9364 * expression to use as id expression
9365 */
9366 idExpr?: string;
9367 /**
9368 * which kind of code should be returned
9369 */
9370 type: "promise" | "expression" | "statements";
9371 }): string;
9372 moduleId(__0: {
9373 /**
9374 * the module
9375 */
9376 module: Module;
9377 /**
9378 * the chunk graph
9379 */
9380 chunkGraph: ChunkGraph;
9381 /**
9382 * the request that should be printed as comment
9383 */
9384 request: string;
9385 /**
9386 * if the dependency is weak (will create a nice error message)
9387 */
9388 weak?: boolean;
9389 }): string;
9390 moduleRaw(__0: {
9391 /**
9392 * the module
9393 */
9394 module: Module;
9395 /**
9396 * the chunk graph
9397 */
9398 chunkGraph: ChunkGraph;
9399 /**
9400 * the request that should be printed as comment
9401 */
9402 request: string;
9403 /**
9404 * if the dependency is weak (will create a nice error message)
9405 */
9406 weak?: boolean;
9407 /**
9408 * if set, will be filled with runtime requirements
9409 */
9410 runtimeRequirements: Set<string>;
9411 }): string;
9412 moduleExports(__0: {
9413 /**
9414 * the module
9415 */
9416 module: Module;
9417 /**
9418 * the chunk graph
9419 */
9420 chunkGraph: ChunkGraph;
9421 /**
9422 * the request that should be printed as comment
9423 */
9424 request: string;
9425 /**
9426 * if the dependency is weak (will create a nice error message)
9427 */
9428 weak?: boolean;
9429 /**
9430 * if set, will be filled with runtime requirements
9431 */
9432 runtimeRequirements: Set<string>;
9433 }): string;
9434 moduleNamespace(__0: {
9435 /**
9436 * the module
9437 */
9438 module: Module;
9439 /**
9440 * the chunk graph
9441 */
9442 chunkGraph: ChunkGraph;
9443 /**
9444 * the request that should be printed as comment
9445 */
9446 request: string;
9447 /**
9448 * if the current module is in strict esm mode
9449 */
9450 strict?: boolean;
9451 /**
9452 * if the dependency is weak (will create a nice error message)
9453 */
9454 weak?: boolean;
9455 /**
9456 * if set, will be filled with runtime requirements
9457 */
9458 runtimeRequirements: Set<string>;
9459 }): string;
9460 moduleNamespacePromise(__0: {
9461 /**
9462 * the chunk graph
9463 */
9464 chunkGraph: ChunkGraph;
9465 /**
9466 * the current dependencies block
9467 */
9468 block?: AsyncDependenciesBlock;
9469 /**
9470 * the module
9471 */
9472 module: Module;
9473 /**
9474 * the request that should be printed as comment
9475 */
9476 request: string;
9477 /**
9478 * a message for the comment
9479 */
9480 message: string;
9481 /**
9482 * if the current module is in strict esm mode
9483 */
9484 strict?: boolean;
9485 /**
9486 * if the dependency is weak (will create a nice error message)
9487 */
9488 weak?: boolean;
9489 /**
9490 * if set, will be filled with runtime requirements
9491 */
9492 runtimeRequirements: Set<string>;
9493 }): string;
9494 runtimeConditionExpression(__0: {
9495 /**
9496 * the chunk graph
9497 */
9498 chunkGraph: ChunkGraph;
9499 /**
9500 * runtime for which this code will be generated
9501 */
9502 runtime?: RuntimeSpec;
9503 /**
9504 * only execute the statement in some runtimes
9505 */
9506 runtimeCondition?: string | boolean | SortableSet<string>;
9507 /**
9508 * if set, will be filled with runtime requirements
9509 */
9510 runtimeRequirements: Set<string>;
9511 }): string;
9512 importStatement(__0: {
9513 /**
9514 * whether a new variable should be created or the existing one updated
9515 */
9516 update?: boolean;
9517 /**
9518 * the module
9519 */
9520 module: Module;
9521 /**
9522 * the chunk graph
9523 */
9524 chunkGraph: ChunkGraph;
9525 /**
9526 * the request that should be printed as comment
9527 */
9528 request: string;
9529 /**
9530 * name of the import variable
9531 */
9532 importVar: string;
9533 /**
9534 * module in which the statement is emitted
9535 */
9536 originModule: Module;
9537 /**
9538 * true, if this is a weak dependency
9539 */
9540 weak?: boolean;
9541 /**
9542 * if set, will be filled with runtime requirements
9543 */
9544 runtimeRequirements: Set<string>;
9545 }): [string, string];
9546 exportFromImport(__0: {
9547 /**
9548 * the module graph
9549 */
9550 moduleGraph: ModuleGraph;
9551 /**
9552 * the module
9553 */
9554 module: Module;
9555 /**
9556 * the request
9557 */
9558 request: string;
9559 /**
9560 * the export name
9561 */
9562 exportName: string | string[];
9563 /**
9564 * the origin module
9565 */
9566 originModule: Module;
9567 /**
9568 * true, if location is safe for ASI, a bracket can be emitted
9569 */
9570 asiSafe?: boolean;
9571 /**
9572 * true, if expression will be called
9573 */
9574 isCall: boolean;
9575 /**
9576 * when false, call context will not be preserved
9577 */
9578 callContext: boolean;
9579 /**
9580 * when true and accessing the default exports, interop code will be generated
9581 */
9582 defaultInterop: boolean;
9583 /**
9584 * the identifier name of the import variable
9585 */
9586 importVar: string;
9587 /**
9588 * init fragments will be added here
9589 */
9590 initFragments: InitFragment[];
9591 /**
9592 * runtime for which this code will be generated
9593 */
9594 runtime: RuntimeSpec;
9595 /**
9596 * if set, will be filled with runtime requirements
9597 */
9598 runtimeRequirements: Set<string>;
9599 }): string;
9600 blockPromise(__0: {
9601 /**
9602 * the async block
9603 */
9604 block: AsyncDependenciesBlock;
9605 /**
9606 * the message
9607 */
9608 message: string;
9609 /**
9610 * the chunk graph
9611 */
9612 chunkGraph: ChunkGraph;
9613 /**
9614 * if set, will be filled with runtime requirements
9615 */
9616 runtimeRequirements: Set<string>;
9617 }): string;
9618 asyncModuleFactory(__0: {
9619 /**
9620 * the async block
9621 */
9622 block: AsyncDependenciesBlock;
9623 /**
9624 * the chunk graph
9625 */
9626 chunkGraph: ChunkGraph;
9627 /**
9628 * if set, will be filled with runtime requirements
9629 */
9630 runtimeRequirements: Set<string>;
9631 /**
9632 * request string used originally
9633 */
9634 request?: string;
9635 }): string;
9636 syncModuleFactory(__0: {
9637 /**
9638 * the dependency
9639 */
9640 dependency: Dependency;
9641 /**
9642 * the chunk graph
9643 */
9644 chunkGraph: ChunkGraph;
9645 /**
9646 * if set, will be filled with runtime requirements
9647 */
9648 runtimeRequirements: Set<string>;
9649 /**
9650 * request string used originally
9651 */
9652 request?: string;
9653 }): string;
9654 defineEsModuleFlagStatement(__0: {
9655 /**
9656 * the name of the exports object
9657 */
9658 exportsArgument: string;
9659 /**
9660 * if set, will be filled with runtime requirements
9661 */
9662 runtimeRequirements: Set<string>;
9663 }): string;
9664}
9665declare abstract class RuntimeValue {
9666 fn: (arg0: {
9667 module: NormalModule;
9668 key: string;
9669 readonly version?: string;
9670 }) => CodeValuePrimitive;
9671 options: true | RuntimeValueOptions;
9672 readonly fileDependencies?: true | string[];
9673 exec(
9674 parser: JavascriptParser,
9675 valueCacheVersions: Map<string, string>,
9676 key: string
9677 ): CodeValuePrimitive;
9678 getCacheVersion(): undefined | string;
9679}
9680declare interface RuntimeValueOptions {
9681 fileDependencies?: string[];
9682 contextDependencies?: string[];
9683 missingDependencies?: string[];
9684 buildDependencies?: string[];
9685 version?: string | (() => string);
9686}
9687type Schema =
9688 | (JSONSchema4 & Extend)
9689 | (JSONSchema6 & Extend)
9690 | (JSONSchema7 & Extend);
9691declare interface ScopeInfo {
9692 definitions: StackedMap<string, ScopeInfo | VariableInfo>;
9693 topLevelScope: boolean | "arrow";
9694 inShorthand: boolean;
9695 isStrict: boolean;
9696 isAsmJs: boolean;
9697 inTry: boolean;
9698}
9699declare interface Selector<A, B> {
9700 (input: A): B;
9701}
9702declare abstract class Serializer {
9703 serializeMiddlewares: any;
9704 deserializeMiddlewares: any;
9705 context: any;
9706 serialize(obj?: any, context?: any): any;
9707 deserialize(value?: any, context?: any): any;
9708}
9709declare class SharePlugin {
9710 constructor(options: SharePluginOptions);
9711
9712 /**
9713 * Apply the plugin
9714 */
9715 apply(compiler: Compiler): void;
9716}
9717
9718/**
9719 * Options for shared modules.
9720 */
9721declare interface SharePluginOptions {
9722 /**
9723 * Share scope name used for all shared modules (defaults to 'default').
9724 */
9725 shareScope?: string;
9726
9727 /**
9728 * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
9729 */
9730 shared: Shared;
9731}
9732type Shared = (string | SharedObject)[] | SharedObject;
9733
9734/**
9735 * Advanced configuration for modules that should be shared in the share scope.
9736 */
9737declare interface SharedConfig {
9738 /**
9739 * 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.
9740 */
9741 eager?: boolean;
9742
9743 /**
9744 * 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.
9745 */
9746 import?: string | false;
9747
9748 /**
9749 * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
9750 */
9751 packageName?: string;
9752
9753 /**
9754 * Version requirement from module in share scope.
9755 */
9756 requiredVersion?: string | false;
9757
9758 /**
9759 * Module is looked up under this key from the share scope.
9760 */
9761 shareKey?: string;
9762
9763 /**
9764 * Share scope name.
9765 */
9766 shareScope?: string;
9767
9768 /**
9769 * Allow only a single version of the shared module in share scope (disabled by default).
9770 */
9771 singleton?: boolean;
9772
9773 /**
9774 * 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).
9775 */
9776 strictVersion?: boolean;
9777
9778 /**
9779 * Version of the provided module. Will replace lower matching versions, but not higher.
9780 */
9781 version?: string | false;
9782}
9783
9784/**
9785 * 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.
9786 */
9787declare interface SharedObject {
9788 [index: string]: string | SharedConfig;
9789}
9790declare class SideEffectsFlagPlugin {
9791 constructor(analyseSource?: boolean);
9792
9793 /**
9794 * Apply the plugin
9795 */
9796 apply(compiler: Compiler): void;
9797 static moduleHasSideEffects(
9798 moduleName?: any,
9799 flagValue?: any,
9800 cache?: any
9801 ): any;
9802}
9803declare class SizeOnlySource extends Source {
9804 constructor(size: number);
9805}
9806declare abstract class Snapshot {
9807 startTime?: number;
9808 fileTimestamps?: Map<string, FileSystemInfoEntry>;
9809 fileHashes?: Map<string, string>;
9810 fileTshs?: Map<string, string | TimestampAndHash>;
9811 contextTimestamps?: Map<string, FileSystemInfoEntry>;
9812 contextHashes?: Map<string, string>;
9813 contextTshs?: Map<string, string | TimestampAndHash>;
9814 missingExistence?: Map<string, boolean>;
9815 managedItemInfo?: Map<string, string>;
9816 managedFiles?: Set<string>;
9817 managedContexts?: Set<string>;
9818 managedMissing?: Set<string>;
9819 children?: Set<Snapshot>;
9820 hasStartTime(): boolean;
9821 setStartTime(value?: any): void;
9822 setMergedStartTime(value?: any, snapshot?: any): void;
9823 hasFileTimestamps(): boolean;
9824 setFileTimestamps(value?: any): void;
9825 hasFileHashes(): boolean;
9826 setFileHashes(value?: any): void;
9827 hasFileTshs(): boolean;
9828 setFileTshs(value?: any): void;
9829 hasContextTimestamps(): boolean;
9830 setContextTimestamps(value?: any): void;
9831 hasContextHashes(): boolean;
9832 setContextHashes(value?: any): void;
9833 hasContextTshs(): boolean;
9834 setContextTshs(value?: any): void;
9835 hasMissingExistence(): boolean;
9836 setMissingExistence(value?: any): void;
9837 hasManagedItemInfo(): boolean;
9838 setManagedItemInfo(value?: any): void;
9839 hasManagedFiles(): boolean;
9840 setManagedFiles(value?: any): void;
9841 hasManagedContexts(): boolean;
9842 setManagedContexts(value?: any): void;
9843 hasManagedMissing(): boolean;
9844 setManagedMissing(value?: any): void;
9845 hasChildren(): boolean;
9846 setChildren(value?: any): void;
9847 addChild(child?: any): void;
9848 serialize(__0: { write: any }): void;
9849 deserialize(__0: { read: any }): void;
9850 getFileIterable(): Iterable<string>;
9851 getContextIterable(): Iterable<string>;
9852 getMissingIterable(): Iterable<string>;
9853}
9854
9855/**
9856 * Options affecting how file system snapshots are created and validated.
9857 */
9858declare interface SnapshotOptions {
9859 /**
9860 * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
9861 */
9862 buildDependencies?: {
9863 /**
9864 * Use hashes of the content of the files/directories to determine invalidation.
9865 */
9866 hash?: boolean;
9867 /**
9868 * Use timestamps of the files/directories to determine invalidation.
9869 */
9870 timestamp?: boolean;
9871 };
9872
9873 /**
9874 * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
9875 */
9876 immutablePaths?: string[];
9877
9878 /**
9879 * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
9880 */
9881 managedPaths?: string[];
9882
9883 /**
9884 * Options for snapshotting dependencies of modules to determine if they need to be built again.
9885 */
9886 module?: {
9887 /**
9888 * Use hashes of the content of the files/directories to determine invalidation.
9889 */
9890 hash?: boolean;
9891 /**
9892 * Use timestamps of the files/directories to determine invalidation.
9893 */
9894 timestamp?: boolean;
9895 };
9896
9897 /**
9898 * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
9899 */
9900 resolve?: {
9901 /**
9902 * Use hashes of the content of the files/directories to determine invalidation.
9903 */
9904 hash?: boolean;
9905 /**
9906 * Use timestamps of the files/directories to determine invalidation.
9907 */
9908 timestamp?: boolean;
9909 };
9910
9911 /**
9912 * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
9913 */
9914 resolveBuildDependencies?: {
9915 /**
9916 * Use hashes of the content of the files/directories to determine invalidation.
9917 */
9918 hash?: boolean;
9919 /**
9920 * Use timestamps of the files/directories to determine invalidation.
9921 */
9922 timestamp?: boolean;
9923 };
9924}
9925declare abstract class SortableSet<T> extends Set<T> {
9926 /**
9927 * Sort with a comparer function
9928 */
9929 sortWith(sortFn: (arg0: T, arg1: T) => number): void;
9930 sort(): SortableSet<T>;
9931
9932 /**
9933 * Get data from cache
9934 */
9935 getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
9936
9937 /**
9938 * Get data from cache (ignoring sorting)
9939 */
9940 getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
9941 toJSON(): T[];
9942
9943 /**
9944 * Iterates over values in the set.
9945 */
9946 [Symbol.iterator](): IterableIterator<T>;
9947 readonly [Symbol.toStringTag]: string;
9948}
9949declare class Source {
9950 constructor();
9951 size(): number;
9952 map(options?: MapOptions): Object;
9953 sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
9954 updateHash(hash: Hash): void;
9955 source(): string | Buffer;
9956 buffer(): Buffer;
9957}
9958declare interface SourceData {
9959 iife?: boolean;
9960 init?: string;
9961 expression: string;
9962}
9963declare interface SourceLike {
9964 source(): string | Buffer;
9965}
9966declare class SourceMapDevToolPlugin {
9967 constructor(options?: SourceMapDevToolPluginOptions);
9968 sourceMapFilename: string | false;
9969 sourceMappingURLComment: string | false;
9970 moduleFilenameTemplate: string | Function;
9971 fallbackModuleFilenameTemplate: string | Function;
9972 namespace: string;
9973 options: SourceMapDevToolPluginOptions;
9974
9975 /**
9976 * Apply the plugin
9977 */
9978 apply(compiler: Compiler): void;
9979}
9980declare interface SourceMapDevToolPluginOptions {
9981 /**
9982 * 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.
9983 */
9984 append?: null | string | false;
9985
9986 /**
9987 * Indicates whether column mappings should be used (defaults to true).
9988 */
9989 columns?: boolean;
9990
9991 /**
9992 * Exclude modules that match the given value from source map generation.
9993 */
9994 exclude?: string | RegExp | Rule[];
9995
9996 /**
9997 * 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.
9998 */
9999 fallbackModuleFilenameTemplate?: string | Function;
10000
10001 /**
10002 * Path prefix to which the [file] placeholder is relative to.
10003 */
10004 fileContext?: string;
10005
10006 /**
10007 * Defines the output filename of the SourceMap (will be inlined if no value is provided).
10008 */
10009 filename?: null | string | false;
10010
10011 /**
10012 * Include source maps for module paths that match the given value.
10013 */
10014 include?: string | RegExp | Rule[];
10015
10016 /**
10017 * Indicates whether SourceMaps from loaders should be used (defaults to true).
10018 */
10019 module?: boolean;
10020
10021 /**
10022 * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
10023 */
10024 moduleFilenameTemplate?: string | Function;
10025
10026 /**
10027 * Namespace prefix to allow multiple webpack roots in the devtools.
10028 */
10029 namespace?: string;
10030
10031 /**
10032 * Omit the 'sourceContents' array from the SourceMap.
10033 */
10034 noSources?: boolean;
10035
10036 /**
10037 * Provide a custom public path for the SourceMapping comment.
10038 */
10039 publicPath?: string;
10040
10041 /**
10042 * Provide a custom value for the 'sourceRoot' property in the SourceMap.
10043 */
10044 sourceRoot?: string;
10045
10046 /**
10047 * Include source maps for modules based on their extension (defaults to .js and .css).
10048 */
10049 test?: string | RegExp | Rule[];
10050}
10051declare class SourceMapSource extends Source {
10052 constructor(
10053 source: string | Buffer,
10054 name: string,
10055 sourceMap: string | Object | Buffer,
10056 originalSource?: string | Buffer,
10057 innerSourceMap?: string | Object | Buffer,
10058 removeOriginalSource?: boolean
10059 );
10060 getArgsAsBuffers(): [
10061 Buffer,
10062 string,
10063 Buffer,
10064 undefined | Buffer,
10065 undefined | Buffer,
10066 boolean
10067 ];
10068}
10069declare interface SourcePosition {
10070 line: number;
10071 column?: number;
10072}
10073declare interface SplitChunksOptions {
10074 chunksFilter: (chunk: Chunk) => boolean;
10075 defaultSizeTypes: string[];
10076 minSize: SplitChunksSizes;
10077 minRemainingSize: SplitChunksSizes;
10078 enforceSizeThreshold: SplitChunksSizes;
10079 maxInitialSize: SplitChunksSizes;
10080 maxAsyncSize: SplitChunksSizes;
10081 minChunks: number;
10082 maxAsyncRequests: number;
10083 maxInitialRequests: number;
10084 hidePathInfo: boolean;
10085 filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
10086 automaticNameDelimiter: string;
10087 getCacheGroups: (
10088 module: Module,
10089 context: CacheGroupsContext
10090 ) => CacheGroupSource[];
10091 getName: (
10092 module?: Module,
10093 chunks?: Chunk[],
10094 key?: string
10095 ) => undefined | string;
10096 usedExports: boolean;
10097 fallbackCacheGroup: FallbackCacheGroup;
10098}
10099declare class SplitChunksPlugin {
10100 constructor(options?: OptimizationSplitChunksOptions);
10101 options: SplitChunksOptions;
10102
10103 /**
10104 * Apply the plugin
10105 */
10106 apply(compiler: Compiler): void;
10107}
10108declare interface SplitChunksSizes {
10109 [index: string]: number;
10110}
10111declare abstract class StackedMap<K, V> {
10112 map: Map<K, InternalCell<V>>;
10113 stack: Map<K, InternalCell<V>>[];
10114 set(item: K, value: V): void;
10115 delete(item: K): void;
10116 has(item: K): boolean;
10117 get(item: K): Cell<V>;
10118 asArray(): K[];
10119 asSet(): Set<K>;
10120 asPairArray(): [K, Cell<V>][];
10121 asMap(): Map<K, Cell<V>>;
10122 readonly size: number;
10123 createChild(): StackedMap<K, V>;
10124}
10125type StartupRenderContext = RenderContextObject & { inlined: boolean };
10126type Statement =
10127 | FunctionDeclaration
10128 | VariableDeclaration
10129 | ClassDeclaration
10130 | ExpressionStatement
10131 | BlockStatement
10132 | EmptyStatement
10133 | DebuggerStatement
10134 | WithStatement
10135 | ReturnStatement
10136 | LabeledStatement
10137 | BreakStatement
10138 | ContinueStatement
10139 | IfStatement
10140 | SwitchStatement
10141 | ThrowStatement
10142 | TryStatement
10143 | WhileStatement
10144 | DoWhileStatement
10145 | ForStatement
10146 | ForInStatement
10147 | ForOfStatement;
10148declare class Stats {
10149 constructor(compilation: Compilation);
10150 compilation: Compilation;
10151 readonly hash?: string;
10152 readonly startTime: any;
10153 readonly endTime: any;
10154 hasWarnings(): boolean;
10155 hasErrors(): boolean;
10156 toJson(options?: string | StatsOptions): StatsCompilation;
10157 toString(options?: any): string;
10158}
10159type StatsAsset = KnownStatsAsset & Record<string, any>;
10160type StatsChunk = KnownStatsChunk & Record<string, any>;
10161type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
10162type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
10163type StatsCompilation = KnownStatsCompilation & Record<string, any>;
10164type StatsError = KnownStatsError & Record<string, any>;
10165declare abstract class StatsFactory {
10166 hooks: Readonly<{
10167 extract: HookMap<SyncBailHook<[Object, any, StatsFactoryContext], any>>;
10168 filter: HookMap<
10169 SyncBailHook<[any, StatsFactoryContext, number, number], any>
10170 >;
10171 sort: HookMap<
10172 SyncBailHook<
10173 [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
10174 any
10175 >
10176 >;
10177 filterSorted: HookMap<
10178 SyncBailHook<[any, StatsFactoryContext, number, number], any>
10179 >;
10180 groupResults: HookMap<
10181 SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
10182 >;
10183 sortResults: HookMap<
10184 SyncBailHook<
10185 [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
10186 any
10187 >
10188 >;
10189 filterResults: HookMap<
10190 SyncBailHook<[any, StatsFactoryContext, number, number], any>
10191 >;
10192 merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
10193 result: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
10194 getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
10195 getItemFactory: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
10196 }>;
10197 create(
10198 type: string,
10199 data: any,
10200 baseContext: Omit<StatsFactoryContext, "type">
10201 ): any;
10202}
10203type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
10204type StatsLogging = KnownStatsLogging & Record<string, any>;
10205type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
10206type StatsModule = KnownStatsModule & Record<string, any>;
10207type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
10208type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
10209type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
10210 Record<string, any>;
10211type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
10212
10213/**
10214 * Stats options object.
10215 */
10216declare interface StatsOptions {
10217 /**
10218 * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
10219 */
10220 all?: boolean;
10221
10222 /**
10223 * Add assets information.
10224 */
10225 assets?: boolean;
10226
10227 /**
10228 * Sort the assets by that field.
10229 */
10230 assetsSort?: string;
10231
10232 /**
10233 * Space to display assets (groups will be collapsed to fit this space).
10234 */
10235 assetsSpace?: number;
10236
10237 /**
10238 * Add built at time information.
10239 */
10240 builtAt?: boolean;
10241
10242 /**
10243 * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
10244 */
10245 cached?: boolean;
10246
10247 /**
10248 * Show cached assets (setting this to `false` only shows emitted files).
10249 */
10250 cachedAssets?: boolean;
10251
10252 /**
10253 * Add information about cached (not built) modules.
10254 */
10255 cachedModules?: boolean;
10256
10257 /**
10258 * Add children information.
10259 */
10260 children?: boolean;
10261
10262 /**
10263 * Display auxiliary assets in chunk groups.
10264 */
10265 chunkGroupAuxiliary?: boolean;
10266
10267 /**
10268 * Display children of chunk groups.
10269 */
10270 chunkGroupChildren?: boolean;
10271
10272 /**
10273 * Limit of assets displayed in chunk groups.
10274 */
10275 chunkGroupMaxAssets?: number;
10276
10277 /**
10278 * Display all chunk groups with the corresponding bundles.
10279 */
10280 chunkGroups?: boolean;
10281
10282 /**
10283 * Add built modules information to chunk information.
10284 */
10285 chunkModules?: boolean;
10286
10287 /**
10288 * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
10289 */
10290 chunkModulesSpace?: number;
10291
10292 /**
10293 * Add the origins of chunks and chunk merging info.
10294 */
10295 chunkOrigins?: boolean;
10296
10297 /**
10298 * Add information about parent, children and sibling chunks to chunk information.
10299 */
10300 chunkRelations?: boolean;
10301
10302 /**
10303 * Add chunk information.
10304 */
10305 chunks?: boolean;
10306
10307 /**
10308 * Sort the chunks by that field.
10309 */
10310 chunksSort?: string;
10311
10312 /**
10313 * Enables/Disables colorful output.
10314 */
10315 colors?:
10316 | boolean
10317 | {
10318 /**
10319 * Custom color for bold text.
10320 */
10321 bold?: string;
10322 /**
10323 * Custom color for cyan text.
10324 */
10325 cyan?: string;
10326 /**
10327 * Custom color for green text.
10328 */
10329 green?: string;
10330 /**
10331 * Custom color for magenta text.
10332 */
10333 magenta?: string;
10334 /**
10335 * Custom color for red text.
10336 */
10337 red?: string;
10338 /**
10339 * Custom color for yellow text.
10340 */
10341 yellow?: string;
10342 };
10343
10344 /**
10345 * Context directory for request shortening.
10346 */
10347 context?: string;
10348
10349 /**
10350 * Show chunk modules that are dependencies of other modules of the chunk.
10351 */
10352 dependentModules?: boolean;
10353
10354 /**
10355 * Add module depth in module graph.
10356 */
10357 depth?: boolean;
10358
10359 /**
10360 * Display the entry points with the corresponding bundles.
10361 */
10362 entrypoints?: boolean | "auto";
10363
10364 /**
10365 * Add --env information.
10366 */
10367 env?: boolean;
10368
10369 /**
10370 * Add details to errors (like resolving log).
10371 */
10372 errorDetails?: boolean | "auto";
10373
10374 /**
10375 * Add internal stack trace to errors.
10376 */
10377 errorStack?: boolean;
10378
10379 /**
10380 * Add errors.
10381 */
10382 errors?: boolean;
10383
10384 /**
10385 * Add errors count.
10386 */
10387 errorsCount?: boolean;
10388
10389 /**
10390 * Please use excludeModules instead.
10391 */
10392 exclude?:
10393 | string
10394 | boolean
10395 | RegExp
10396 | ModuleFilterItemTypes[]
10397 | ((
10398 name: string,
10399 module: StatsModule,
10400 type: "module" | "chunk" | "root-of-chunk" | "nested"
10401 ) => boolean);
10402
10403 /**
10404 * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
10405 */
10406 excludeAssets?:
10407 | string
10408 | RegExp
10409 | AssetFilterItemTypes[]
10410 | ((name: string, asset: StatsAsset) => boolean);
10411
10412 /**
10413 * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
10414 */
10415 excludeModules?:
10416 | string
10417 | boolean
10418 | RegExp
10419 | ModuleFilterItemTypes[]
10420 | ((
10421 name: string,
10422 module: StatsModule,
10423 type: "module" | "chunk" | "root-of-chunk" | "nested"
10424 ) => boolean);
10425
10426 /**
10427 * Group assets by how their are related to chunks.
10428 */
10429 groupAssetsByChunk?: boolean;
10430
10431 /**
10432 * Group assets by their status (emitted, compared for emit or cached).
10433 */
10434 groupAssetsByEmitStatus?: boolean;
10435
10436 /**
10437 * Group assets by their extension.
10438 */
10439 groupAssetsByExtension?: boolean;
10440
10441 /**
10442 * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
10443 */
10444 groupAssetsByInfo?: boolean;
10445
10446 /**
10447 * Group assets by their path.
10448 */
10449 groupAssetsByPath?: boolean;
10450
10451 /**
10452 * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
10453 */
10454 groupModulesByAttributes?: boolean;
10455
10456 /**
10457 * Group modules by their status (cached or built and cacheable).
10458 */
10459 groupModulesByCacheStatus?: boolean;
10460
10461 /**
10462 * Group modules by their extension.
10463 */
10464 groupModulesByExtension?: boolean;
10465
10466 /**
10467 * Group modules by their layer.
10468 */
10469 groupModulesByLayer?: boolean;
10470
10471 /**
10472 * Group modules by their path.
10473 */
10474 groupModulesByPath?: boolean;
10475
10476 /**
10477 * Group modules by their type.
10478 */
10479 groupModulesByType?: boolean;
10480
10481 /**
10482 * Add the hash of the compilation.
10483 */
10484 hash?: boolean;
10485
10486 /**
10487 * Add ids.
10488 */
10489 ids?: boolean;
10490
10491 /**
10492 * Add logging output.
10493 */
10494 logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log";
10495
10496 /**
10497 * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
10498 */
10499 loggingDebug?:
10500 | string
10501 | boolean
10502 | RegExp
10503 | FilterItemTypes[]
10504 | ((value: string) => boolean);
10505
10506 /**
10507 * Add stack traces to logging output.
10508 */
10509 loggingTrace?: boolean;
10510
10511 /**
10512 * Add information about assets inside modules.
10513 */
10514 moduleAssets?: boolean;
10515
10516 /**
10517 * Add dependencies and origin of warnings/errors.
10518 */
10519 moduleTrace?: boolean;
10520
10521 /**
10522 * Add built modules information.
10523 */
10524 modules?: boolean;
10525
10526 /**
10527 * Sort the modules by that field.
10528 */
10529 modulesSort?: string;
10530
10531 /**
10532 * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
10533 */
10534 modulesSpace?: number;
10535
10536 /**
10537 * Add information about modules nested in other modules (like with module concatenation).
10538 */
10539 nestedModules?: boolean;
10540
10541 /**
10542 * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
10543 */
10544 nestedModulesSpace?: number;
10545
10546 /**
10547 * Show reasons why optimization bailed out for modules.
10548 */
10549 optimizationBailout?: boolean;
10550
10551 /**
10552 * Add information about orphan modules.
10553 */
10554 orphanModules?: boolean;
10555
10556 /**
10557 * Add output path information.
10558 */
10559 outputPath?: boolean;
10560
10561 /**
10562 * Add performance hint flags.
10563 */
10564 performance?: boolean;
10565
10566 /**
10567 * Preset for the default values.
10568 */
10569 preset?: string | boolean;
10570
10571 /**
10572 * Show exports provided by modules.
10573 */
10574 providedExports?: boolean;
10575
10576 /**
10577 * Add public path information.
10578 */
10579 publicPath?: boolean;
10580
10581 /**
10582 * Add information about the reasons why modules are included.
10583 */
10584 reasons?: boolean;
10585
10586 /**
10587 * Add information about assets that are related to other assets (like SourceMaps for assets).
10588 */
10589 relatedAssets?: boolean;
10590
10591 /**
10592 * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
10593 */
10594 runtime?: boolean;
10595
10596 /**
10597 * Add information about runtime modules.
10598 */
10599 runtimeModules?: boolean;
10600
10601 /**
10602 * Add the source code of modules.
10603 */
10604 source?: boolean;
10605
10606 /**
10607 * Add timing information.
10608 */
10609 timings?: boolean;
10610
10611 /**
10612 * Show exports used by modules.
10613 */
10614 usedExports?: boolean;
10615
10616 /**
10617 * Add webpack version information.
10618 */
10619 version?: boolean;
10620
10621 /**
10622 * Add warnings.
10623 */
10624 warnings?: boolean;
10625
10626 /**
10627 * Add warnings count.
10628 */
10629 warningsCount?: boolean;
10630
10631 /**
10632 * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
10633 */
10634 warningsFilter?:
10635 | string
10636 | RegExp
10637 | WarningFilterItemTypes[]
10638 | ((warning: StatsError, value: string) => boolean);
10639}
10640declare abstract class StatsPrinter {
10641 hooks: Readonly<{
10642 sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true>>;
10643 printElements: HookMap<
10644 SyncBailHook<[PrintedElement[], StatsPrinterContext], string>
10645 >;
10646 sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
10647 getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
10648 printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
10649 print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
10650 result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
10651 }>;
10652 print(type: string, object: Object, baseContext?: Object): string;
10653}
10654type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
10655type StatsProfile = KnownStatsProfile & Record<string, any>;
10656type StatsValue =
10657 | boolean
10658 | "none"
10659 | "summary"
10660 | "errors-only"
10661 | "errors-warnings"
10662 | "minimal"
10663 | "normal"
10664 | "detailed"
10665 | "verbose"
10666 | StatsOptions;
10667declare interface SyntheticDependencyLocation {
10668 name: string;
10669 index?: number;
10670}
10671declare const TOMBSTONE: unique symbol;
10672declare const TRANSITIVE_ONLY: unique symbol;
10673declare interface TagInfo {
10674 tag: any;
10675 data: any;
10676 next?: TagInfo;
10677}
10678declare class Template {
10679 constructor();
10680 static getFunctionContent(fn: Function): string;
10681 static toIdentifier(str: string): string;
10682 static toComment(str: string): string;
10683 static toNormalComment(str: string): string;
10684 static toPath(str: string): string;
10685 static numberToIdentifier(n: number): string;
10686 static numberToIdentifierContinuation(n: number): string;
10687 static indent(s: string | string[]): string;
10688 static prefix(s: string | string[], prefix: string): string;
10689 static asString(str: string | string[]): string;
10690 static getModulesArrayBounds(modules: WithId[]): false | [number, number];
10691 static renderChunkModules(
10692 renderContext: RenderContextModuleTemplate,
10693 modules: Module[],
10694 renderModule: (arg0: Module) => Source,
10695 prefix?: string
10696 ): Source;
10697 static renderRuntimeModules(
10698 runtimeModules: RuntimeModule[],
10699 renderContext: RenderContextModuleTemplate & {
10700 codeGenerationResults?: CodeGenerationResults;
10701 useStrict?: boolean;
10702 }
10703 ): Source;
10704 static renderChunkRuntimeModules(
10705 runtimeModules: RuntimeModule[],
10706 renderContext: RenderContextModuleTemplate
10707 ): Source;
10708 static NUMBER_OF_IDENTIFIER_START_CHARS: number;
10709 static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
10710}
10711declare interface TimestampAndHash {
10712 safeTime: number;
10713 timestamp?: number;
10714 timestampHash?: string;
10715 hash: string;
10716}
10717declare const UNDEFINED_MARKER: unique symbol;
10718declare interface UpdateHashContextDependency {
10719 chunkGraph: ChunkGraph;
10720 runtime: RuntimeSpec;
10721 runtimeTemplate?: RuntimeTemplate;
10722}
10723declare interface UpdateHashContextGenerator {
10724 /**
10725 * the module
10726 */
10727 module: NormalModule;
10728 chunkGraph: ChunkGraph;
10729 runtime: RuntimeSpec;
10730}
10731type UsageStateType = 0 | 1 | 2 | 3 | 4;
10732declare interface UserResolveOptions {
10733 /**
10734 * A list of module alias configurations or an object which maps key to value
10735 */
10736 alias?: AliasOption[] | AliasOptions;
10737
10738 /**
10739 * A list of module alias configurations or an object which maps key to value, applied only after modules option
10740 */
10741 fallback?: AliasOption[] | AliasOptions;
10742
10743 /**
10744 * A list of alias fields in description files
10745 */
10746 aliasFields?: (string | string[])[];
10747
10748 /**
10749 * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
10750 */
10751 cachePredicate?: (arg0: ResolveRequest) => boolean;
10752
10753 /**
10754 * Whether or not the unsafeCache should include request context as part of the cache key.
10755 */
10756 cacheWithContext?: boolean;
10757
10758 /**
10759 * A list of description files to read from
10760 */
10761 descriptionFiles?: string[];
10762
10763 /**
10764 * A list of exports field condition names.
10765 */
10766 conditionNames?: string[];
10767
10768 /**
10769 * Enforce that a extension from extensions must be used
10770 */
10771 enforceExtension?: boolean;
10772
10773 /**
10774 * A list of exports fields in description files
10775 */
10776 exportsFields?: (string | string[])[];
10777
10778 /**
10779 * A list of imports fields in description files
10780 */
10781 importsFields?: (string | string[])[];
10782
10783 /**
10784 * A list of extensions which should be tried for files
10785 */
10786 extensions?: string[];
10787
10788 /**
10789 * The file system which should be used
10790 */
10791 fileSystem: FileSystem;
10792
10793 /**
10794 * Use this cache object to unsafely cache the successful requests
10795 */
10796 unsafeCache?: boolean | object;
10797
10798 /**
10799 * Resolve symlinks to their symlinked location
10800 */
10801 symlinks?: boolean;
10802
10803 /**
10804 * A prepared Resolver to which the plugins are attached
10805 */
10806 resolver?: Resolver;
10807
10808 /**
10809 * A list of directories to resolve modules from, can be absolute path or folder name
10810 */
10811 modules?: string | string[];
10812
10813 /**
10814 * A list of main fields in description files
10815 */
10816 mainFields?: (
10817 | string
10818 | string[]
10819 | { name: string | string[]; forceRelative: boolean }
10820 )[];
10821
10822 /**
10823 * A list of main files in directories
10824 */
10825 mainFiles?: string[];
10826
10827 /**
10828 * A list of additional resolve plugins which should be applied
10829 */
10830 plugins?: Plugin[];
10831
10832 /**
10833 * A PnP API that should be used - null is "never", undefined is "auto"
10834 */
10835 pnpApi?: null | PnpApiImpl;
10836
10837 /**
10838 * A list of root paths
10839 */
10840 roots?: string[];
10841
10842 /**
10843 * The request is already fully specified and no extensions or directories are resolved for it
10844 */
10845 fullySpecified?: boolean;
10846
10847 /**
10848 * Resolve to a context instead of a file
10849 */
10850 resolveToContext?: boolean;
10851
10852 /**
10853 * A list of resolve restrictions
10854 */
10855 restrictions?: (string | RegExp)[];
10856
10857 /**
10858 * Use only the sync constiants of the file system calls
10859 */
10860 useSyncFileSystemCalls?: boolean;
10861
10862 /**
10863 * Prefer to resolve module requests as relative requests before falling back to modules
10864 */
10865 preferRelative?: boolean;
10866
10867 /**
10868 * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
10869 */
10870 preferAbsolute?: boolean;
10871}
10872declare abstract class VariableInfo {
10873 declaredScope: ScopeInfo;
10874 freeName: string | true;
10875 tagInfo?: TagInfo;
10876}
10877declare interface VariableInfoInterface {
10878 declaredScope: ScopeInfo;
10879 freeName: string | true;
10880 tagInfo?: TagInfo;
10881}
10882type WarningFilterItemTypes =
10883 | string
10884 | RegExp
10885 | ((warning: StatsError, value: string) => boolean);
10886declare interface WatchFileSystem {
10887 watch: (
10888 files: Iterable<string>,
10889 directories: Iterable<string>,
10890 missing: Iterable<string>,
10891 startTime: number,
10892 options: WatchOptions,
10893 callback: (
10894 arg0: undefined | Error,
10895 arg1: Map<string, FileSystemInfoEntry | "ignore">,
10896 arg2: Map<string, FileSystemInfoEntry | "ignore">,
10897 arg3: Set<string>,
10898 arg4: Set<string>
10899 ) => void,
10900 callbackUndelayed: (arg0: string, arg1: number) => void
10901 ) => Watcher;
10902}
10903declare class WatchIgnorePlugin {
10904 constructor(options: WatchIgnorePluginOptions);
10905 paths: (string | RegExp)[];
10906
10907 /**
10908 * Apply the plugin
10909 */
10910 apply(compiler: Compiler): void;
10911}
10912declare interface WatchIgnorePluginOptions {
10913 /**
10914 * A list of RegExps or absolute paths to directories or files that should be ignored.
10915 */
10916 paths: (string | RegExp)[];
10917}
10918
10919/**
10920 * Options for the watcher.
10921 */
10922declare interface WatchOptions {
10923 /**
10924 * Delay the rebuilt after the first change. Value is a time in ms.
10925 */
10926 aggregateTimeout?: number;
10927
10928 /**
10929 * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
10930 */
10931 followSymlinks?: boolean;
10932
10933 /**
10934 * Ignore some files from watching (glob pattern or regexp).
10935 */
10936 ignored?: string | RegExp | string[];
10937
10938 /**
10939 * Enable polling mode for watching.
10940 */
10941 poll?: number | boolean;
10942
10943 /**
10944 * Stop watching when stdin stream has ended.
10945 */
10946 stdin?: boolean;
10947}
10948declare interface Watcher {
10949 /**
10950 * closes the watcher and all underlying file watchers
10951 */
10952 close: () => void;
10953
10954 /**
10955 * closes the watcher, but keeps underlying file watchers alive until the next watch call
10956 */
10957 pause: () => void;
10958
10959 /**
10960 * get current aggregated changes that have not yet send to callback
10961 */
10962 getAggregatedChanges?: () => Set<string>;
10963
10964 /**
10965 * get current aggregated removals that have not yet send to callback
10966 */
10967 getAggregatedRemovals?: () => Set<string>;
10968
10969 /**
10970 * get info about files
10971 */
10972 getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
10973
10974 /**
10975 * get info about directories
10976 */
10977 getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
10978}
10979declare abstract class Watching {
10980 startTime: null | number;
10981 invalid: boolean;
10982 handler: CallbackFunction<Stats>;
10983 callbacks: CallbackFunction<void>[];
10984 closed: boolean;
10985 suspended: boolean;
10986 blocked: boolean;
10987 watchOptions: {
10988 /**
10989 * Delay the rebuilt after the first change. Value is a time in ms.
10990 */
10991 aggregateTimeout?: number;
10992 /**
10993 * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
10994 */
10995 followSymlinks?: boolean;
10996 /**
10997 * Ignore some files from watching (glob pattern or regexp).
10998 */
10999 ignored?: string | RegExp | string[];
11000 /**
11001 * Enable polling mode for watching.
11002 */
11003 poll?: number | boolean;
11004 /**
11005 * Stop watching when stdin stream has ended.
11006 */
11007 stdin?: boolean;
11008 };
11009 compiler: Compiler;
11010 running: boolean;
11011 watcher: any;
11012 pausedWatcher: any;
11013 watch(
11014 files: Iterable<string>,
11015 dirs: Iterable<string>,
11016 missing: Iterable<string>
11017 ): void;
11018 invalidate(callback?: CallbackFunction<void>): void;
11019 suspend(): void;
11020 resume(): void;
11021 close(callback: CallbackFunction<void>): void;
11022}
11023declare class WebWorkerTemplatePlugin {
11024 constructor();
11025
11026 /**
11027 * Apply the plugin
11028 */
11029 apply(compiler: Compiler): void;
11030}
11031declare class WebpackError extends Error {
11032 /**
11033 * Creates an instance of WebpackError.
11034 */
11035 constructor(message?: string);
11036 details: any;
11037 module: Module;
11038 loc: DependencyLocation;
11039 hideStack: boolean;
11040 chunk: Chunk;
11041 file: string;
11042 serialize(__0: { write: any }): void;
11043 deserialize(__0: { read: any }): void;
11044
11045 /**
11046 * Create .stack property on a target object
11047 */
11048 static captureStackTrace(
11049 targetObject: object,
11050 constructorOpt?: Function
11051 ): void;
11052
11053 /**
11054 * Optional override for formatting stack traces
11055 */
11056 static prepareStackTrace?: (
11057 err: Error,
11058 stackTraces: NodeJS.CallSite[]
11059 ) => any;
11060 static stackTraceLimit: number;
11061}
11062declare abstract class WebpackLogger {
11063 getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
11064 error(...args: any[]): void;
11065 warn(...args: any[]): void;
11066 info(...args: any[]): void;
11067 log(...args: any[]): void;
11068 debug(...args: any[]): void;
11069 assert(assertion: any, ...args: any[]): void;
11070 trace(): void;
11071 clear(): void;
11072 status(...args: any[]): void;
11073 group(...args: any[]): void;
11074 groupCollapsed(...args: any[]): void;
11075 groupEnd(...args: any[]): void;
11076 profile(label?: any): void;
11077 profileEnd(label?: any): void;
11078 time(label?: any): void;
11079 timeLog(label?: any): void;
11080 timeEnd(label?: any): void;
11081 timeAggregate(label?: any): void;
11082 timeAggregateEnd(label?: any): void;
11083}
11084declare class WebpackOptionsApply extends OptionsApply {
11085 constructor();
11086}
11087declare class WebpackOptionsDefaulter {
11088 constructor();
11089 process(options?: any): any;
11090}
11091
11092/**
11093 * Normalized webpack options object.
11094 */
11095declare interface WebpackOptionsNormalized {
11096 /**
11097 * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
11098 */
11099 amd?: false | { [index: string]: any };
11100
11101 /**
11102 * Report the first error as a hard error instead of tolerating it.
11103 */
11104 bail?: boolean;
11105
11106 /**
11107 * Cache generated modules and chunks to improve performance for multiple incremental builds.
11108 */
11109 cache: CacheOptionsNormalized;
11110
11111 /**
11112 * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
11113 */
11114 context?: string;
11115
11116 /**
11117 * References to other configurations to depend on.
11118 */
11119 dependencies?: string[];
11120
11121 /**
11122 * Options for the webpack-dev-server.
11123 */
11124 devServer?: DevServer;
11125
11126 /**
11127 * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
11128 */
11129 devtool?: string | false;
11130
11131 /**
11132 * The entry point(s) of the compilation.
11133 */
11134 entry: EntryNormalized;
11135
11136 /**
11137 * Enables/Disables experiments (experimental features with relax SemVer compatibility).
11138 */
11139 experiments: Experiments;
11140
11141 /**
11142 * 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`.
11143 */
11144 externals: Externals;
11145
11146 /**
11147 * Enable presets of externals for specific targets.
11148 */
11149 externalsPresets: ExternalsPresets;
11150
11151 /**
11152 * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
11153 */
11154 externalsType?:
11155 | "var"
11156 | "module"
11157 | "assign"
11158 | "this"
11159 | "window"
11160 | "self"
11161 | "global"
11162 | "commonjs"
11163 | "commonjs2"
11164 | "commonjs-module"
11165 | "amd"
11166 | "amd-require"
11167 | "umd"
11168 | "umd2"
11169 | "jsonp"
11170 | "system"
11171 | "promise"
11172 | "import"
11173 | "script";
11174
11175 /**
11176 * Ignore specific warnings.
11177 */
11178 ignoreWarnings?: ((
11179 warning: WebpackError,
11180 compilation: Compilation
11181 ) => boolean)[];
11182
11183 /**
11184 * Options for infrastructure level logging.
11185 */
11186 infrastructureLogging: InfrastructureLogging;
11187
11188 /**
11189 * Custom values available in the loader context.
11190 */
11191 loader?: Loader;
11192
11193 /**
11194 * Enable production optimizations or development hints.
11195 */
11196 mode?: "development" | "production" | "none";
11197
11198 /**
11199 * Options affecting the normal modules (`NormalModuleFactory`).
11200 */
11201 module: ModuleOptionsNormalized;
11202
11203 /**
11204 * Name of the configuration. Used when loading multiple configurations.
11205 */
11206 name?: string;
11207
11208 /**
11209 * Include polyfills or mocks for various node stuff.
11210 */
11211 node: NodeWebpackOptions;
11212
11213 /**
11214 * Enables/Disables integrated optimizations.
11215 */
11216 optimization: Optimization;
11217
11218 /**
11219 * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
11220 */
11221 output: OutputNormalized;
11222
11223 /**
11224 * The number of parallel processed modules in the compilation.
11225 */
11226 parallelism?: number;
11227
11228 /**
11229 * Configuration for web performance recommendations.
11230 */
11231 performance?: false | PerformanceOptions;
11232
11233 /**
11234 * Add additional plugins to the compiler.
11235 */
11236 plugins: (
11237 | ((this: Compiler, compiler: Compiler) => void)
11238 | WebpackPluginInstance
11239 )[];
11240
11241 /**
11242 * Capture timing information for each module.
11243 */
11244 profile?: boolean;
11245
11246 /**
11247 * Store compiler state to a json file.
11248 */
11249 recordsInputPath?: string | false;
11250
11251 /**
11252 * Load compiler state from a json file.
11253 */
11254 recordsOutputPath?: string | false;
11255
11256 /**
11257 * Options for the resolver.
11258 */
11259 resolve: ResolveOptionsWebpackOptions;
11260
11261 /**
11262 * Options for the resolver when resolving loaders.
11263 */
11264 resolveLoader: ResolveOptionsWebpackOptions;
11265
11266 /**
11267 * Options affecting how file system snapshots are created and validated.
11268 */
11269 snapshot: SnapshotOptions;
11270
11271 /**
11272 * Stats options object or preset name.
11273 */
11274 stats: StatsValue;
11275
11276 /**
11277 * Environment to build for. An array of environments to build for all of them when possible.
11278 */
11279 target?: string | false | string[];
11280
11281 /**
11282 * Enter watch mode, which rebuilds on file change.
11283 */
11284 watch?: boolean;
11285
11286 /**
11287 * Options for the watcher.
11288 */
11289 watchOptions: WatchOptions;
11290}
11291
11292/**
11293 * Plugin instance.
11294 */
11295declare interface WebpackPluginInstance {
11296 [index: string]: any;
11297
11298 /**
11299 * The run point of the plugin, required method.
11300 */
11301 apply: (compiler: Compiler) => void;
11302}
11303declare interface WithId {
11304 id: string | number;
11305}
11306declare interface WithOptions {
11307 /**
11308 * create a resolver with additional/different options
11309 */
11310 withOptions: (
11311 arg0: Partial<ResolveOptionsWithDependencyType>
11312 ) => ResolverWithOptions;
11313}
11314declare interface WriteOnlySet<T> {
11315 add: (T?: any) => void;
11316}
11317type __TypeWebpackOptions = (
11318 data: object
11319) =>
11320 | string
11321 | {
11322 /**
11323 * Unique loader options identifier.
11324 */
11325 ident?: string;
11326 /**
11327 * Loader name.
11328 */
11329 loader?: string;
11330 /**
11331 * Loader options.
11332 */
11333 options?: string | { [index: string]: any };
11334 }
11335 | __TypeWebpackOptions
11336 | RuleSetUseItem[];
11337declare function exports(
11338 options: Configuration,
11339 callback?: CallbackWebpack<Stats>
11340): Compiler;
11341declare function exports(
11342 options: Configuration[] & MultiCompilerOptions,
11343 callback?: CallbackWebpack<MultiStats>
11344): MultiCompiler;
11345declare namespace exports {
11346 export const webpack: {
11347 (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
11348 (
11349 options: Configuration[] & MultiCompilerOptions,
11350 callback?: CallbackWebpack<MultiStats>
11351 ): MultiCompiler;
11352 };
11353 export const validate: (options?: any) => void;
11354 export const validateSchema: (
11355 schema: Schema,
11356 options: object | object[],
11357 validationConfiguration?: ValidationErrorConfiguration
11358 ) => void;
11359 export const version: string;
11360 export namespace cli {
11361 export let getArguments: (schema?: any) => Record<string, Argument>;
11362 export let processArguments: (
11363 args: Record<string, Argument>,
11364 config: any,
11365 values: Record<
11366 string,
11367 | string
11368 | number
11369 | boolean
11370 | RegExp
11371 | (string | number | boolean | RegExp)[]
11372 >
11373 ) => null | Problem[];
11374 }
11375 export namespace ModuleFilenameHelpers {
11376 export let ALL_LOADERS_RESOURCE: string;
11377 export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
11378 export let LOADERS_RESOURCE: string;
11379 export let REGEXP_LOADERS_RESOURCE: RegExp;
11380 export let RESOURCE: string;
11381 export let REGEXP_RESOURCE: RegExp;
11382 export let ABSOLUTE_RESOURCE_PATH: string;
11383 export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
11384 export let RESOURCE_PATH: string;
11385 export let REGEXP_RESOURCE_PATH: RegExp;
11386 export let ALL_LOADERS: string;
11387 export let REGEXP_ALL_LOADERS: RegExp;
11388 export let LOADERS: string;
11389 export let REGEXP_LOADERS: RegExp;
11390 export let QUERY: string;
11391 export let REGEXP_QUERY: RegExp;
11392 export let ID: string;
11393 export let REGEXP_ID: RegExp;
11394 export let HASH: string;
11395 export let REGEXP_HASH: RegExp;
11396 export let NAMESPACE: string;
11397 export let REGEXP_NAMESPACE: RegExp;
11398 export let createFilename: (
11399 module: any,
11400 options: any,
11401 __2: { requestShortener: any; chunkGraph: any }
11402 ) => any;
11403 export let replaceDuplicates: (
11404 array?: any,
11405 fn?: any,
11406 comparator?: any
11407 ) => any;
11408 export let matchPart: (str?: any, test?: any) => any;
11409 export let matchObject: (obj?: any, str?: any) => boolean;
11410 }
11411 export namespace RuntimeGlobals {
11412 export let require: string;
11413 export let requireScope: string;
11414 export let exports: string;
11415 export let thisAsExports: string;
11416 export let returnExportsFromRuntime: string;
11417 export let module: string;
11418 export let moduleId: string;
11419 export let moduleLoaded: string;
11420 export let publicPath: string;
11421 export let entryModuleId: string;
11422 export let moduleCache: string;
11423 export let moduleFactories: string;
11424 export let moduleFactoriesAddOnly: string;
11425 export let ensureChunk: string;
11426 export let ensureChunkHandlers: string;
11427 export let ensureChunkIncludeEntries: string;
11428 export let prefetchChunk: string;
11429 export let prefetchChunkHandlers: string;
11430 export let preloadChunk: string;
11431 export let preloadChunkHandlers: string;
11432 export let definePropertyGetters: string;
11433 export let makeNamespaceObject: string;
11434 export let createFakeNamespaceObject: string;
11435 export let compatGetDefaultExport: string;
11436 export let harmonyModuleDecorator: string;
11437 export let nodeModuleDecorator: string;
11438 export let getFullHash: string;
11439 export let wasmInstances: string;
11440 export let instantiateWasm: string;
11441 export let uncaughtErrorHandler: string;
11442 export let scriptNonce: string;
11443 export let loadScript: string;
11444 export let chunkName: string;
11445 export let runtimeId: string;
11446 export let getChunkScriptFilename: string;
11447 export let getChunkUpdateScriptFilename: string;
11448 export let startup: string;
11449 export let startupNoDefault: string;
11450 export let startupOnlyAfter: string;
11451 export let startupOnlyBefore: string;
11452 export let chunkCallback: string;
11453 export let startupEntrypoint: string;
11454 export let onChunksLoaded: string;
11455 export let externalInstallChunk: string;
11456 export let interceptModuleExecution: string;
11457 export let global: string;
11458 export let shareScopeMap: string;
11459 export let initializeSharing: string;
11460 export let currentRemoteGetScope: string;
11461 export let getUpdateManifestFilename: string;
11462 export let hmrDownloadManifest: string;
11463 export let hmrDownloadUpdateHandlers: string;
11464 export let hmrModuleData: string;
11465 export let hmrInvalidateModuleHandlers: string;
11466 export let amdDefine: string;
11467 export let amdOptions: string;
11468 export let system: string;
11469 export let hasOwnProperty: string;
11470 export let systemContext: string;
11471 export let baseURI: string;
11472 export let relativeUrl: string;
11473 export let asyncModule: string;
11474 }
11475 export const UsageState: Readonly<{
11476 Unused: 0;
11477 OnlyPropertiesUsed: 1;
11478 NoInfo: 2;
11479 Unknown: 3;
11480 Used: 4;
11481 }>;
11482 export const WebpackOptionsValidationError: ValidationError;
11483 export const ValidationError: ValidationError;
11484 export namespace cache {
11485 export { MemoryCachePlugin };
11486 }
11487 export namespace config {
11488 export const getNormalizedWebpackOptions: (
11489 config: Configuration
11490 ) => WebpackOptionsNormalized;
11491 export const applyWebpackOptionsDefaults: (
11492 options: WebpackOptionsNormalized
11493 ) => void;
11494 }
11495 export namespace dependencies {
11496 export { ModuleDependency, ConstDependency, NullDependency };
11497 }
11498 export namespace ids {
11499 export {
11500 ChunkModuleIdRangePlugin,
11501 NaturalModuleIdsPlugin,
11502 OccurrenceModuleIdsPlugin,
11503 NamedModuleIdsPlugin,
11504 DeterministicChunkIdsPlugin,
11505 DeterministicModuleIdsPlugin,
11506 NamedChunkIdsPlugin,
11507 OccurrenceChunkIdsPlugin,
11508 HashedModuleIdsPlugin
11509 };
11510 }
11511 export namespace javascript {
11512 export {
11513 EnableChunkLoadingPlugin,
11514 JavascriptModulesPlugin,
11515 JavascriptParser
11516 };
11517 }
11518 export namespace optimize {
11519 export {
11520 AggressiveMergingPlugin,
11521 AggressiveSplittingPlugin,
11522 LimitChunkCountPlugin,
11523 MinChunkSizePlugin,
11524 ModuleConcatenationPlugin,
11525 RealContentHashPlugin,
11526 RuntimeChunkPlugin,
11527 SideEffectsFlagPlugin,
11528 SplitChunksPlugin
11529 };
11530 }
11531 export namespace runtime {
11532 export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
11533 }
11534 export namespace prefetch {
11535 export { ChunkPrefetchPreloadPlugin };
11536 }
11537 export namespace web {
11538 export {
11539 FetchCompileAsyncWasmPlugin,
11540 FetchCompileWasmPlugin,
11541 JsonpChunkLoadingRuntimeModule,
11542 JsonpTemplatePlugin
11543 };
11544 }
11545 export namespace webworker {
11546 export { WebWorkerTemplatePlugin };
11547 }
11548 export namespace node {
11549 export {
11550 NodeEnvironmentPlugin,
11551 NodeSourcePlugin,
11552 NodeTargetPlugin,
11553 NodeTemplatePlugin,
11554 ReadFileCompileWasmPlugin
11555 };
11556 }
11557 export namespace electron {
11558 export { ElectronTargetPlugin };
11559 }
11560 export namespace wasm {
11561 export { AsyncWebAssemblyModulesPlugin };
11562 }
11563 export namespace library {
11564 export { AbstractLibraryPlugin, EnableLibraryPlugin };
11565 }
11566 export namespace container {
11567 export const scope: <T>(
11568 scope: string,
11569 options: ContainerOptionsFormat<T>
11570 ) => Record<string, string | string[] | T>;
11571 export {
11572 ContainerPlugin,
11573 ContainerReferencePlugin,
11574 ModuleFederationPlugin
11575 };
11576 }
11577 export namespace sharing {
11578 export const scope: <T>(
11579 scope: string,
11580 options: ContainerOptionsFormat<T>
11581 ) => Record<string, string | string[] | T>;
11582 export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
11583 }
11584 export namespace debug {
11585 export { ProfilingPlugin };
11586 }
11587 export namespace util {
11588 export const createHash: (algorithm: string | typeof Hash) => Hash;
11589 export namespace comparators {
11590 export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
11591 export let compareModulesByIdentifier: (
11592 a: Module,
11593 b: Module
11594 ) => 0 | 1 | -1;
11595 export let compareModulesById: ParameterizedComparator<
11596 ChunkGraph,
11597 Module
11598 >;
11599 export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
11600 export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
11601 export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
11602 ModuleGraph,
11603 Module
11604 >;
11605 export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
11606 ModuleGraph,
11607 Module
11608 >;
11609 export let compareModulesByIdOrIdentifier: ParameterizedComparator<
11610 ChunkGraph,
11611 Module
11612 >;
11613 export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
11614 export let compareIds: (
11615 a: string | number,
11616 b: string | number
11617 ) => 0 | 1 | -1;
11618 export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
11619 export let compareChunkGroupsByIndex: (
11620 a: ChunkGroup,
11621 b: ChunkGroup
11622 ) => 0 | 1 | -1;
11623 export let concatComparators: <T>(
11624 c1: Comparator<T>,
11625 c2: Comparator<T>,
11626 ...cRest: Comparator<T>[]
11627 ) => Comparator<T>;
11628 export let compareSelect: <T, R>(
11629 getter: Selector<T, R>,
11630 comparator: Comparator<R>
11631 ) => Comparator<T>;
11632 export let compareIterables: <T>(
11633 elementComparator: Comparator<T>
11634 ) => Comparator<Iterable<T>>;
11635 export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
11636 export let compareChunksNatural: (
11637 chunkGraph: ChunkGraph
11638 ) => Comparator<Chunk>;
11639 export let compareLocations: (
11640 a: DependencyLocation,
11641 b: DependencyLocation
11642 ) => 0 | 1 | -1;
11643 }
11644 export namespace serialization {
11645 export let register: (
11646 Constructor: Constructor,
11647 request: string,
11648 name: string,
11649 serializer: ObjectSerializer
11650 ) => void;
11651 export let registerLoader: (
11652 regExp: RegExp,
11653 loader: (arg0: string) => boolean
11654 ) => void;
11655 export let registerNotSerializable: (Constructor: Constructor) => void;
11656 export let NOT_SERIALIZABLE: object;
11657 export let buffersSerializer: Serializer;
11658 export let createFileSerializer: (fs?: any) => Serializer;
11659 export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
11660 }
11661 export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
11662 export { LazySet };
11663 }
11664 export namespace sources {
11665 export {
11666 Source,
11667 RawSource,
11668 OriginalSource,
11669 ReplaceSource,
11670 SourceMapSource,
11671 ConcatSource,
11672 PrefixSource,
11673 CachedSource,
11674 SizeOnlySource,
11675 CompatSource
11676 };
11677 }
11678 export namespace experiments {
11679 export namespace schemes {
11680 export { HttpUriPlugin, HttpsUriPlugin };
11681 }
11682 }
11683 export type WebpackPluginFunction = (
11684 this: Compiler,
11685 compiler: Compiler
11686 ) => void;
11687 export {
11688 AutomaticPrefetchPlugin,
11689 AsyncDependenciesBlock,
11690 BannerPlugin,
11691 Cache,
11692 Chunk,
11693 ChunkGraph,
11694 CleanPlugin,
11695 Compilation,
11696 Compiler,
11697 ConcatenationScope,
11698 ContextExclusionPlugin,
11699 ContextReplacementPlugin,
11700 DefinePlugin,
11701 DelegatedPlugin,
11702 Dependency,
11703 DllPlugin,
11704 DllReferencePlugin,
11705 DynamicEntryPlugin,
11706 EntryOptionPlugin,
11707 EntryPlugin,
11708 EnvironmentPlugin,
11709 EvalDevToolModulePlugin,
11710 EvalSourceMapDevToolPlugin,
11711 ExternalModule,
11712 ExternalsPlugin,
11713 Generator,
11714 HotUpdateChunk,
11715 HotModuleReplacementPlugin,
11716 IgnorePlugin,
11717 JavascriptModulesPlugin,
11718 LibManifestPlugin,
11719 LibraryTemplatePlugin,
11720 LoaderOptionsPlugin,
11721 LoaderTargetPlugin,
11722 Module,
11723 ModuleGraph,
11724 ModuleGraphConnection,
11725 NoEmitOnErrorsPlugin,
11726 NormalModule,
11727 NormalModuleReplacementPlugin,
11728 MultiCompiler,
11729 Parser,
11730 PrefetchPlugin,
11731 ProgressPlugin,
11732 ProvidePlugin,
11733 RuntimeModule,
11734 EntryPlugin as SingleEntryPlugin,
11735 SourceMapDevToolPlugin,
11736 Stats,
11737 Template,
11738 WatchIgnorePlugin,
11739 WebpackError,
11740 WebpackOptionsApply,
11741 WebpackOptionsDefaulter,
11742 Entry,
11743 EntryNormalized,
11744 EntryObject,
11745 LibraryOptions,
11746 ModuleOptions,
11747 ResolveOptionsWebpackOptions as ResolveOptions,
11748 RuleSetCondition,
11749 RuleSetConditionAbsolute,
11750 RuleSetRule,
11751 RuleSetUse,
11752 RuleSetUseItem,
11753 Configuration,
11754 WebpackOptionsNormalized,
11755 WebpackPluginInstance,
11756 Asset,
11757 AssetInfo,
11758 MultiStats,
11759 ParserState,
11760 Watching,
11761 StatsAsset,
11762 StatsChunk,
11763 StatsChunkGroup,
11764 StatsChunkOrigin,
11765 StatsCompilation,
11766 StatsError,
11767 StatsLogging,
11768 StatsLoggingEntry,
11769 StatsModule,
11770 StatsModuleIssuer,
11771 StatsModuleReason,
11772 StatsModuleTraceDependency,
11773 StatsModuleTraceItem,
11774 StatsProfile
11775 };
11776}
11777
11778export = exports;