npm / enhanced-resolve
enhanced-resolve
What changed in enhanced-resolve 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
1 breaking1 security1 new APIs and options1 performance4 behavior and defaults11 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initenhanced-resolve 519 changes
Breaking changes 1
Stack entries now declare name as string | undefined rather than as an optional property.
Security 1
Fixes a bypass where an in-root symlink points outside the root, allowing it to evade restrictions.
New APIs and options 1
Exposes the resolved package as packageId and accepts it as context.packageId, allowing unambiguous resolution when package entries share a URL.
Performance 1
Reduces hot-path allocations in the resolve pipeline.
Behavior and default changes 4
Options and the context path now accept file: URL strings wherever a path is accepted.
The resolver works in browsers, Deno, and Bun as well as Node; browser use requires supplying your own fileSystem.
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.
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.
Fixes and other changes 11
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.
The object form of Plugin no longer types apply with this: Resolver, matching its runtime call where this is the plugin.
Reads a file: URL the way Node does when parsing a request.
Discovery now soft-fails when it loads a broken tsconfig, rather than failing outright.
Relative paths in tsconfig extends remain relative.
Keeps the original request resolvable when extensionAlias lists its own extension.
Fixes string restriction boundary checks and normalizes comparisons, including Windows path matching; the same comparison backs tsconfig path matching.
Treats UNC paths as Windows paths, applying path.win32 semantics for normalization, joining, and walking up instead of treating them as bare module requests.
Resolves tsconfig extends package specifiers from ancestor node_modules directories, supporting workspace hoisting.
Callbacks from one synchronous burst are batched into a single tick.
When a package exports target is filtered out by restrictions, resolution falls back to the next modules entry instead of throwing.