/** * @inline * @minLength 1 * @absolutePath false */ export type NonEmptyRelativePath = string; /** * @inline * @minLength 1 * @pattern ^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$ */ export type DottedIdentifier = string; /** * @inline * @absolutePath true */ export type AbsolutePath = string; /** * @inline * @absolutePath false */ export type RelativePath = string; /** * @inline * @pattern ^https?:// */ export type HttpUrl = string; /** * @inline * @minLength 1 */ export type NonEmptyString = string; /** * @inline * @pattern ^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map(-debugids)?(-scopes)?$ */ export type DevToolSpelling = string; /** * @inline * @minimum 0 */ export type NonNegativeNumber = number; /** * @inline * @minimum 1 */ export type PositiveNumber = number; /** * Set the value of `require.amd` and `define.amd`. Or disable AMD support. */ export type Amd = /** You can pass `false` to disable AMD support. */ false | /** You can pass an object to set the value of `require.amd` and `define.amd`. */ { [key: string]: any; }; /** * Add a container for define/require functions in the AMD module. */ export type AmdContainer = NonEmptyString; /** * Filtering value, regexp or function. * @cliHelper */ export type AssetFilterItemTypes = RegExp | RelativePath | import("../lib/stats/DefaultStatsFactoryPlugin").AssetFilterItemFn; /** * Filtering modules. * @cliHelper */ export type AssetFilterTypes = Array | AssetFilterItemTypes; /** * The options for data url generator. */ export type AssetGeneratorDataUrl = AssetGeneratorDataUrlOptions | AssetGeneratorDataUrlFunction; /** * Function that executes for module and should return an DataUrl string. It can have a string as 'ident' property which contributes to the module hash. */ export type AssetGeneratorDataUrlFunction = import("../lib/asset/AssetGenerator").DataUrlFunction; /** * Options object for data url generation. */ export interface AssetGeneratorDataUrlOptions { /** * Asset encoding (defaults to base64). */ encoding?: false | "base64"; /** * Asset mimetype (getting from file extension by default). */ mimetype?: string; } /** * Generator options for asset modules. * @implements #/definitions/AssetInlineGeneratorOptions, #/definitions/AssetResourceGeneratorOptions * @publishes plugins/asset/AssetGeneratorOptions */ export type AssetGeneratorOptions = AssetInlineGeneratorOptions & AssetResourceGeneratorOptions; /** * Generator options for asset/inline modules. * @publishes plugins/asset/AssetInlineGeneratorOptions */ export interface AssetInlineGeneratorOptions { /** * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text. */ binary?: boolean; /** * The options for data url generator. */ dataUrl?: AssetGeneratorDataUrl; } /** * The filename of asset modules as relative path inside the 'output.path' directory. */ export type AssetModuleFilename = NonEmptyRelativePath | import("../lib/template/TemplatedPathPlugin").TemplatePathFn; /** * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there. */ export type AssetModuleOutputPath = RelativePath | import("../lib/template/TemplatedPathPlugin").TemplatePathFn; /** * Function that executes for module and should return whenever asset should be inlined as DataUrl. */ export type AssetParserDataUrlFunction = import("../lib/asset/AssetParser").AssetParserDataUrlFunction; /** * Options object for DataUrl condition. */ export interface AssetParserDataUrlOptions { /** * Maximum size of asset that should be inline as modules. Default: 8kb. */ maxSize?: number; } /** * Parser options for asset modules. * @publishes plugins/asset/AssetParserOptions */ export interface AssetParserOptions { /** * The condition for inlining the asset as DataUrl. */ dataUrlCondition?: AssetParserDataUrlOptions | AssetParserDataUrlFunction; } /** * Generator options for asset/resource modules. * @publishes plugins/asset/AssetResourceGeneratorOptions */ export interface AssetResourceGeneratorOptions { /** * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text. */ binary?: boolean; /** * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR. */ emit?: boolean; /** * The filename of asset modules as relative path inside the 'output.path' directory. */ filename?: AssetModuleFilename; /** * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there. */ outputPath?: AssetModuleOutputPath; /** * The 'publicPath' specifies the public URL address of the output files when referenced in a browser. */ publicPath?: RawPublicPath; } /** * Add a comment in the UMD wrapper. */ export type AuxiliaryComment = /** Append the same comment above each import style. */ string | LibraryCustomUmdCommentObject; /** * Report the first error as a hard error instead of tolerating it. */ export type Bail = boolean; /** * A build dependency for filesystem cache invalidation. * @since 5.111.0 */ export type BuildDependencyItem = /** Request to a dependency (resolved as directory relative to the context directory). */ NonEmptyString | { /** * Request to a dependency (resolved as directory relative to the context directory). */ dependency: NonEmptyString; /** * When true, the dependency may be missing. Existence changes invalidate the cache. */ optional?: boolean; }; /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ export type CacheOptions = /** Enable in memory caching. */ true | CacheOptionsNormalized; /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ export type CacheOptionsNormalized = /** Disable caching. */ false | MemoryCacheOptions | FileCacheOptions; /** * Add charset attribute for script tag. */ export type Charset = boolean; /** * Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk. */ export type ChunkFilename = FilenameTemplate; /** * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins). */ export type ChunkFormat = ("array-push" | "commonjs" | "module" | false) | string; /** * Number of milliseconds before chunk request expires. */ export type ChunkLoadTimeout = number; /** * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins). */ export type ChunkLoading = false | ChunkLoadingType; /** * The global variable used by webpack for loading of chunks. */ export type ChunkLoadingGlobal = string; /** * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins). */ export type ChunkLoadingType = ("jsonp" | "import-scripts" | "require" | "async-node" | "import") | string; /** * Clean the output directory before emit. */ export type Clean = boolean | CleanOptions; /** * Advanced options for cleaning assets. * @publishes plugins/output/CleanOptions */ export interface CleanOptions { /** * Log the assets that should be removed instead of deleting them. */ dry?: boolean; /** * Keep these assets. */ keep?: RegExp | RelativePath | import("../lib/output/CleanPlugin").KeepFn | GlobCondition; } /** * Check if to be emitted file already exists and have the same content before writing to output filesystem. */ export type CompareBeforeEmit = boolean; /** * Advanced options for module concatenation. * @since 5.109.0 */ export interface ConcatenateModulesOptions { /** * Also concatenate CommonJS modules with statically analyzable exports. Defaults to 'true'. */ commonjs?: boolean; } /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. */ export type Context = AbsolutePath; /** * Copy files and directories to the output directory. * @since 5.111.0 */ export type Copy = CopyPattern[] | /** Glob or path from where the files are copied. A glob separates with '/', matches dot files, and takes '*', '**', '?', '[]' and '{}'. */ NonEmptyString; /** * Options of the glob in 'from'. */ export interface CopyGlobOptions { /** * Whether the glob matches the case of a file name. Defaults to 'true'. */ caseSensitive?: boolean; /** * How many directory levels below the base of the glob are read, where '1' reads only the base itself. Defaults to no limit. */ deep?: PositiveNumber; /** * Whether the glob reaches a file or a directory whose name starts with a dot without naming it. Defaults to 'true'. */ dot?: boolean; /** * Whether a symbolic link is resolved and copied as what it points at. Defaults to 'true'; 'false' copies the link itself, pointing where it already points. */ followSymlinks?: boolean; /** * Globs of the files which are not copied, resolved like 'from'. A directory one of them matches is skipped whole. */ ignore?: Array; } /** * A pattern of files which are copied to the output directory. */ export interface CopyObjectPattern { /** * Directory 'from' is resolved from and the copied paths are relative to. Defaults to the compiler context, and to what 'from' names when it is not a glob. */ context?: string; /** * Filename template of a copied file inside 'to'. Defaults to '[path][base]', which keeps the name and the directory structure below 'from'. */ filename?: RelativePath | import("../lib/output/CopyPlugin").CopyFilenameFunction; /** * Glob or path from where the files are copied. */ from: /** Globs or paths from where the files are copied, in order. @minItems 1 */ Array | /** Glob or path from where the files are copied. A glob separates with '/', matches dot files, and takes '*', '**', '?', '[]' and '{}'. */ NonEmptyString; /** * Options of the glob in 'from'. */ globOptions?: CopyGlobOptions; /** * Asset info of a copied file. */ info?: /** Asset info of a copied file. @additionalProperties @emptyProperties */ import("../lib/Compilation").AssetInfo | /** Asset info of a copied file, from the file itself. */ import("../lib/output/CopyPlugin").CopyInfoFunction; /** * Whether a copied file keeps the permissions of the file it was copied from. Defaults to 'false', which gives it the ones a new file gets. Has no effect on Windows. */ preservePermissions?: boolean; /** * Whether a copied file keeps the access and modification times of the file it was copied from. Defaults to 'false', which stamps it with the time it was written. */ preserveTimestamps?: boolean; /** * Directory the files are copied to, relative to 'output.path', which is where they land by default. */ to?: /** Directory the files are copied to, relative to 'output.path', which is where they land by default. */ RelativePath | /** Directory a copied file is copied to, relative to 'output.path', from the file itself. */ import("../lib/output/CopyPlugin").CopyToFunction; /** * Modifies the content of a copied file. */ transform?: /** Modifies the content of a copied file, and says how the result is cached. */ { /** * Whether the result of the transform is cached, and what it is cached under. Defaults to 'true'. */ cache?: /** Whether the result of the transform is cached. */ boolean | /** What the result of the transform is cached under, beside the content of the file. */ { /** * Everything beside the content of the file the transform depends on, serialized into the cache key as JSON. */ keys?: /** Everything beside the content of the file the transform depends on, serialized into the cache key as JSON. @additionalProperties @emptyProperties */ import("../lib/output/CopyPlugin").CopyTransformCacheKeys | /** Everything beside the content of the file the transform depends on, from the file itself. */ import("../lib/output/CopyPlugin").CopyTransformCacheKeysFunction; }; /** * Modifies the content of a copied file. */ transformer: import("../lib/output/CopyPlugin").CopyTransform; } | /** Modifies the content of a copied file. */ import("../lib/output/CopyPlugin").CopyTransform; } /** * Patterns of files which are copied to the output directory, and the options of the copying itself. */ export interface CopyOptions { /** * Maximum number of files which are read at the same time. Defaults to '100'. */ concurrency?: PositiveNumber; /** * Patterns of files which are copied to the output directory. * @cliExclude */ patterns: CopyPatterns; /** * Stage of 'processAssets' the files are copied at. Defaults to 'Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL', where a copied file is still minimized and compressed like every other asset; a later stage leaves it as it is on disk. */ stage?: number; } /** * A glob or a path of files which are copied to the output directory. */ export type CopyPattern = /** Glob or path from where the files are copied. A glob separates with '/', matches dot files, and takes '*', '**', '?', '[]' and '{}'. */ NonEmptyString | CopyObjectPattern; /** * Patterns of files which are copied to the output directory. * @cliExclude */ export type CopyPatterns = CopyPattern[]; /** * This option enables cross-origin loading of chunks. */ export type CrossOriginLoading = false | "anonymous" | "use-credentials"; /** * Parser options for css/auto and css/module modules. * @publishes plugins/css/CssAutoOrModuleParserOptions */ export interface CssAutoOrModuleParserOptions { /** * Enable/disable renaming of `@keyframes`. */ animation?: CssParserAnimation; /** * Configure how the CSS source is parsed: as a full stylesheet (default) or as a block's contents (e.g. the content of an HTML `style` attribute). */ as?: CssParserAs; /** * Enable/disable renaming of `@container` names. */ container?: CssParserContainer; /** * Enable/disable renaming of custom identifiers. */ customIdents?: CssParserCustomIdents; /** * Enable/disable resolution of `@custom-media` at-rules (file-local build-time substitution). * @since 5.109.0 */ customMedia?: CssParserCustomMedia; /** * Enable/disable resolution of `@custom-selector` at-rules (file-local build-time expansion to `:is(...)`). * @since 5.109.0 */ customSelectors?: CssParserCustomSelectors; /** * Enable/disable renaming of dashed identifiers, e. g. custom properties. */ dashedIdents?: CssParserDashedIdents; /** * Configure how CSS content is exported as default. */ exportType?: CssParserExportType; /** * Auto-emit `` for the primary `src` URL of each `@font-face` reachable from an HTML entry's initial CSS. Only the first URL per `@font-face` is preloaded (preloading every format would double-download). Off by default; `parser.css.urlHints` rules and per-URL magic comments still override the seeded defaults. Set `output.crossOriginLoading` so the preload matches the font's CORS fetch. * @since 5.109.0 */ fontPreload?: CssParserFontPreload; /** * Enable/disable renaming of `@function` names. */ function?: CssParserFunction; /** * Enable/disable renaming of grid identifiers. */ grid?: CssParserGrid; /** * Enable/disable `@import` at-rules handling. */ import?: CssParserImport; /** * Use ES modules named export for css exports. */ namedExports?: CssParserNamedExports; /** * Enable strict pure mode: every selector must contain at least one local class or id selector. */ pure?: CssParserPure; /** * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling. */ url?: CssParserUrl; /** * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `` / `` / `