unstale

npm / enhanced-resolve

enhanced-resolve

What changed in enhanced-resolve 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

10 breaking1 security17 new APIs and options8 performance12 behavior and defaults40 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

enhanced-resolve 588 changes

Breaking changes 10

  • Stack entries now declare name as string | undefined rather than as an optional property.

    5.26.0release notes

  • Resolution no longer falls back to a parent node_modules when an exports target file is not found.

    5.21.0release notes

  • Non-relative imports targets such as #a pointing to #b no longer re-enter imports resolution, matching Node.js ESM behavior.

    5.21.0release notes

  • CacheFileSystem allows only synchronous usage and supports a second options argument for all methods.

    5.0.0release notes

  • The context property is removed from the Node API.

    5.0.0release notes

  • A real filesystem can be used without providing join, following the removal of memory-fs.

    5.0.0release notes

  • The loader property is removed from the Node API.

    5.0.0release notes

  • The minimum supported Node.js version increases, affecting which runtimes can run this release.

    5.0.0release notes

  • module/ now resolves to a directory rather than to module.js as a file.

    5.0.0release notes

  • NodeJsInputFileSystem is removed.

    5.0.0release notes

Security 1

  • Fixes a bypass where an in-root symlink points outside the root, allowing it to evade restrictions.

    5.22.1release notes

New APIs and options 17

  • Adds readdirPrefix so purge with exact: true still removes cached directory listings below what.

    5.27.0release notes

  • The UnsafeCache type of the unsafeCache option is now exported for use by developers.

    5.26.2release notes

  • Exposes the resolved package as packageId and accepts it as context.packageId, allowing unambiguous resolution when package entries share a URL.

    5.26.0release notes

  • Accepts a second options argument with exact; when true, removes only entries whose key exactly matches what instead of entries whose key starts with what.

    5.22.0release notes

  • When true, extensionAlias also applies to paths resolved through the package.json exports field; it is off by default to match Node.js.

    5.21.0release notes

  • A promise API was added, and resolution can be performed without context and resolveContext.

    5.21.0release notes

  • The baseUrl option can override the tsconfig.json's baseUrl.

    5.20.0release notes

  • Added TsconfigPathsPlugin as a replacement for tsconfig-paths-webpack-plugin.

    5.19.0release notes

  • The conditionNames option is added as part of support for the package.json exports field.

    5.0.0release notes

  • The exportsFields option is added as part of support for the package.json exports field.

    5.0.0release notes

  • The fallback option works like alias but activates only when normal resolving fails.

    5.0.0release notes

  • Fragment support is added.

    5.0.0release notes

  • The fullySpecified option is added for better Node.js ESM compatibility.

    5.0.0release notes

  • Support is added for the imports field in package.json.

    5.0.0release notes

  • The restrictions option limits the paths that are allowed to resolve.

    5.0.0release notes

  • The roots option is added.

    5.0.0release notes

  • Yarn Plug’n’Play resolution is supported, and PnP tracks dependency to the .pnp.js file.

    5.0.0release notes

Performance 8

  • Reduces hot-path allocations in the resolve pipeline.

    5.24.1release notes

  • Alias resolution is faster on the hot path, especially for alias-heavy configurations.

    5.21.6release notes

  • Optimizes path checks, context scanning, matching, cache checks, hot paths, and per-resolve allocations.

    5.21.2release notes

  • JSON comment stripping and parsing results are cached, avoiding redundant work when resolving tsconfig.json files and improving TsconfigPathsPlugin warm performance.

    5.21.0release notes

  • Performance of many plugins was improved.

    5.21.0release notes

  • Improves resolver cache hit rate, which may improve resolution performance.

    5.20.1release notes

  • Optimizes TsconfigPathsPlugin, which may improve resolution performance for projects using it.

    5.20.1release notes

  • The number of filesystem accesses is optimized and reduced by serializing all operations.

    5.0.0release notes

Behavior and default changes 12

  • Options and the context path now accept file: URL strings wherever a path is accepted.

    5.25.0release notes

  • The resolver works in browsers, Deno, and Bun as well as Node; browser use requires supplying your own fileSystem.

    5.24.0release notes

  • The context path and request arguments of resolve, resolveSync, and resolvePromise accept file: URL instances, which are converted to filesystem paths; plain strings remain literal paths.

    5.24.0release notes

  • Path-like resolve options roots, modules, alias/fallback targets, restrictions, and tsconfig settings now accept file URL instances and convert them to filesystem paths; plain strings remain literal paths.

    5.23.0release notes

  • TsconfigPathsPlugin now supports extending from unscoped npm packages.

    5.21.2release notes

  • Comments in JSONC-formatted tsconfig.json files are supported.

    5.20.0release notes

  • JSONC parsing now supports trailing commas.

    5.20.0release notes

  • The resolver now handles the file: schema.

    5.18.4release notes

  • Alias values can now be arrays.

    5.0.0release notes

  • An alias value of false is supported, allowing an entry such as alias: { something: false }.

    5.0.0release notes

  • Dependencies are tracked while resolving, including the .pnp.js file for Yarn PnP.

    5.0.0release notes

  • Self reference resolving is supported when the package.json exports field is present.

    5.0.0release notes

Fixes and other changes 40

  • An inherited baseUrl substitutes ${configDir}, and an empty baseUrl is treated as the directory of its tsconfig, like tsc.

    5.26.2release notes

  • tsconfig extends resolution now follows tsc, including package exports.

    5.26.2release notes

  • Inherited paths without a baseUrl are resolved relative to the tsconfig that declares them.

    5.26.2release notes

  • Extending a tsconfig no longer changes it for later loads that share the file system cache.

    5.26.2release notes

  • File system types now accept fs typed by @types/node 26.

    5.26.1release notes

  • Failed resolution now diagnoses exports or imports fields that place subpaths inside conditions, naming offending keys and showing the supported arrangement; field-processing errors also name their package.json.

    5.26.0release notes

  • The object form of Plugin no longer types apply with this: Resolver, matching its runtime call where this is the plugin.

    5.26.0release notes

  • Reads a file: URL the way Node does when parsing a request.

    5.25.1release notes

  • Discovery now soft-fails when it loads a broken tsconfig, rather than failing outright.

    5.24.5release notes

  • Relative paths in tsconfig extends remain relative.

    5.24.5release notes

  • Keeps the original request resolvable when extensionAlias lists its own extension.

    5.24.4release notes

  • Fixes string restriction boundary checks and normalizes comparisons, including Windows path matching; the same comparison backs tsconfig path matching.

    5.24.4release notes

  • Treats UNC paths as Windows paths, applying path.win32 semantics for normalization, joining, and walking up instead of treating them as bare module requests.

    5.24.4release notes

  • Resolves tsconfig extends package specifiers from ancestor node_modules directories, supporting workspace hoisting.

    5.24.3release notes

  • Callbacks from one synchronous burst are batched into a single tick.

    5.24.2release notes

  • When a package exports target is filtered out by restrictions, resolution falls back to the next modules entry instead of throwing.

    5.22.2release notes

  • No longer adds configDir to modules when tsconfig has no baseUrl, avoiding an unintended change to module resolution.

    5.21.5release notes

  • When tsconfig: true is used, enhanced-resolve walks up parent directories to find tsconfig.json, matching TypeScript's own findConfigFile behavior.

    5.21.4release notes

  • When a paths pattern matches but its mapped path does not exist, resolution falls through to normal module resolution, allowing packages such as @sentry/react to resolve from node_modules.

    5.21.3release notes

  • Fixes circular project references that could cause a stack overflow.

    5.21.2release notes

  • Restores compatibility with plugin iteration using [...resolveContext.stack].

    5.21.1release notes

  • Supports resolveSync when useSyncFileSystemCalls is enabled.

    5.21.1release notes

  • Avoids out-of-memory behavior when duration is Infinity.

    5.21.0release notes

  • DOS device paths such as \\?\… and \\.\… are now handled properly.

    5.21.0release notes

  • The extensionAlias option now applies to the imports field to align with TypeScript resolution.

    5.21.0release notes

  • Fixed behavior when tsconfig: true is used and no default tsconfig.json file exists.

    5.21.0release notes

  • Fixes extends resolution bugs in TsconfigPathsPlugin.

    5.20.1release notes

  • Circular extends in tsconfig.json is detected to prevent an infinite loop.

    5.20.0release notes

  • Subpath imports that start with #/ are now allowed.

    5.18.4release notes

  • Duplicate entries in aliasFields are deduplicated.

    5.0.0release notes

  • Duplicate entries in descriptionFiles are deduplicated.

    5.0.0release notes

  • Duplicate entries in extensions are deduplicated.

    5.0.0release notes

  • A bug involving lowercase file letters is fixed.

    5.0.0release notes

  • The crash caused by setting main to "." is fixed.

    5.0.0release notes

  • Duplicate entries in mainFields are deduplicated.

    5.0.0release notes

  • Duplicate entries in mainFiles are deduplicated.

    5.0.0release notes

  • Duplicate entries in modules are deduplicated.

    5.0.0release notes

  • A bug where a same-named file in the modules file was resolved instead of the package is fixed.

    5.0.0release notes

  • Purging of readdir is fixed.

    5.0.0release notes

  • Handling of scoped packages is improved.

    5.0.0release notes