Options
All
  • Public
  • Public/Protected
  • All
Menu

Options object for resolving requests.

Hierarchy

  • ResolveOptions

Index

Properties

alias?: { alias: string | false | string[]; name: string; onlyModule?: boolean }[] | {}

Redirect module requests.

aliasFields?: (string | string[])[]

Fields in the description file (usually package.json) which are used to redirect requests inside the module.

byDependency?: {}

Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".

cache?: boolean

Enable caching of successfully resolved requests (cache entries are revalidated).

cacheWithContext?: boolean

Include the context information in the cache identifier when caching.

conditionNames?: string[]

Condition names for exports field entry point.

descriptionFiles?: string[]

Filenames used to find a description file (like a package.json).

enforceExtension?: boolean

Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).

exportsFields?: string[]

Field names from the description file (usually package.json) which are used to provide entry points of a package.

extensionAlias?: {}

An object which maps extension to extension aliases.

Type declaration

  • [index: string]: string | string[]
extensions?: string[]

Extensions added to the request when trying to find the file.

fallback?: { alias: string | false | string[]; name: string; onlyModule?: boolean }[] | {}

Redirect module requests when normal resolving fails.

fileSystem?: InputFileSystem

Filesystem for the resolver.

fullySpecified?: boolean

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).

importsFields?: string[]

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).

mainFields?: (string | string[])[]

Field names from the description file (package.json) which are used to find the default entry point.

mainFiles?: string[]

Filenames used to find the default entry point if there is no description file or main field.

modules?: string[]

Folder names or directory paths where to find modules.

plugins?: (undefined | null | false | "" | 0 | "..." | ResolvePluginInstance)[]

Plugins for the resolver.

preferAbsolute?: boolean

Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.

preferRelative?: boolean

Prefer to resolve module requests as relative request and fallback to resolving as module.

resolver?: Resolver

Custom resolver.

restrictions?: (string | RegExp)[]

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.

roots?: string[]

A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.

symlinks?: boolean

Enable resolving symlinks to the original location.

unsafeCache?: boolean | {}

Enable caching of successfully resolved requests (cache entries are not revalidated).

useSyncFileSystemCalls?: boolean

Use synchronous filesystem calls for the resolver.

Methods

  • Predicate function to decide which requests should be cached.

    Parameters

    Returns boolean