UNPKG

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