Options object for resolving requests.

Hierarchy

  • ResolveOptionsWebpackOptions

Properties

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

Redirect module requests.

Type declaration

  • [index: string]: string | false | string[]
aliasFields?: (string | string[])[]

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

byDependency?: {
    [index: string]: ResolveOptionsWebpackOptions;
}

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

Type declaration

cache?: boolean

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

cachePredicate?: ((request) => boolean)

Type declaration

    • (request): boolean
    • Predicate function to decide which requests should be cached.

      Parameters

      Returns boolean

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?: {
    [index: string]: string | string[];
}

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;
}[] | {
    [index: string]: string | false | string[];
}

Redirect module requests when normal resolving fails.

Type declaration

  • [index: string]: string | false | string[]
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?: ("..." | 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 | {
    [index: string]: any;
}

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

Type declaration

  • [index: string]: any
useSyncFileSystemCalls?: boolean

Use synchronous filesystem calls for the resolver.

Generated using TypeDoc