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