UNPKG

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