Skip to content

Releases: webpack/enhanced-resolve

v5.24.0

11 Jun 14:06
af82f5a

Choose a tag to compare

Minor Changes

  • Allow the context path and request arguments of resolve (and resolveSync/resolvePromise) to accept file: URL instances, converting them to filesystem paths. Plain strings stay literal paths, matching Node's fs. (by @alexander-akait in #607)

Patch Changes

  • Make the resolver runtime-agnostic so it works in browsers, Deno and Bun as well as Node. File contents are decoded without assuming a Node Buffer, and browser shims are provided for the path, url and graceful-fs builtins (Node, Deno and Bun keep using the native ones) so the package bundles for the browser — supply your own fileSystem there. (by @alexander-akait in #606)

  • Rename the positional resolve/resolveSync/resolvePromise parameters to parent/specifier (from path/request) for ESM-aligned naming and document them in the README. Purely cosmetic — arguments are positional, so there is no behavior or API change. (by @alexander-akait in #611)

v5.23.0

05 Jun 13:46
476fad1

Choose a tag to compare

Minor Changes

  • Allow the path-like resolve options roots, modules, alias/fallback targets, restrictions, and tsconfig (the config file, configFile, baseUrl, and references) to accept file URL instances (such as new URL("./dir/", import.meta.url)), converting them to filesystem paths. Plain strings are still treated as literal paths, matching Node's fs. (by @alexander-akait in #604)

v5.22.2

03 Jun 17:43
487659b

Choose a tag to compare

Patch Changes

  • Fall back to the next modules entry when a package exports target is filtered out by restrictions, instead of throwing. (by @alexander-akait in #600)

v5.22.1

28 May 16:15
ec96727

Choose a tag to compare

Patch Changes

  • Fix restrictions bypass via an in-root symlink pointing outside the root. (by @alexander-akait in #595)

v5.22.0

22 May 09:39
25b923a

Choose a tag to compare

Minor Changes

  • CachedInputFileSystem#purge accepts a second { exact?: boolean } argument; exact: true removes only entries whose key matches what exactly instead of any entry whose key starts with what. (by @alexander-akait in #591)

v5.21.6

20 May 16:15
658315c

Choose a tag to compare

Patch Changes

  • Speed up alias resolution on the hot path. (by @alexander-akait in #589)

    • AliasPlugin / TsconfigPathsPlugin: bucket compiled alias options by the first char code of name, so resolves skip options whose name can't possibly match the request's first char. Gated to cases with 2+ distinct first chars so degenerate single-bucket lists (e.g. long alias chains) don't pay for the Map.get.
    • TsconfigPathsPlugin: memoize _selectPathsDataForContext(map, requestPath) per map so the per-source-file contextList scan only runs once per directory. Gated to maps with 2+ contexts so single-context tsconfigs aren't penalized by the cache lookup.

    Biggest wins on alias-heavy configs (300+ entries): huge-alias-miss +151%, huge-alias-list +126%, alias-first-char-miss +120%.

v5.21.5

19 May 12:32
6a83888

Choose a tag to compare

Patch Changes

v5.21.4

18 May 17:10
e6f2158

Choose a tag to compare

Patch Changes

  • When tsconfig: true is used, walk up parent directories to find tsconfig.json, matching TypeScript's own findConfigFile behavior. (by @xiaoxiaojx in #585)

v5.21.3

11 May 16:23
d09bdb2

Choose a tag to compare

Patch Changes

  • TsconfigPathsPlugin now falls through to normal module resolution when a paths pattern matches but the mapped path does not exist, matching TypeScript's native resolution behavior. Previously, patterns like "@*" would block scoped npm packages (e.g. @sentry/react) from resolving via node_modules. (by @xiaoxiaojx in #579)

v5.21.2

08 May 11:49
605c5ca

Choose a tag to compare

Patch Changes

  • Fix TsconfigPathsPlugin circular project references causing stack overflow, add support for extending from unscoped npm packages, and use stat instead of readFile for existence checks in extends resolution. (by @xiaoxiaojx in #575)

  • perf: dedupe miss paths in DirectoryExistsPlugin/FileExistsPlugin and prune the per-resolve TsconfigPathsPlugin context scan. (by @alexander-akait in #574)

  • perf: drop a dead Map lookup in findMatch and flatten AliasFieldPlugin's cache check. (by @alexander-akait in #574)

  • perf: hot-path tweaks in ImportsFieldPlugin, AliasUtils, and util/entrypoints. (by @alexander-akait in #574)

  • perf: cut per-resolve allocations in Resolver.parse, loadDescriptionFile, and TsconfigPathsPlugin._selectPathsDataForContext. (by @alexander-akait in #574)