UNPKG

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