Releases: webpack/enhanced-resolve
v5.21.0
Minor Changes
-
Added promise API and support to resolve without
contextandresolveContext. (by @alexander-akait in #520) -
Add
extensionAliasForExportsoption. Whentrue,extensionAliasalso applies to paths resolved through thepackage.jsonexportsfield. Off by default to match Node.js; opt in for full TypeScript-resolver parity with packages that ship.tssources alongside the compiled.jsthey declare inexports. (by @alexander-akait in #554)
Patch Changes
-
Properly handle DOS device paths (
\\?\…and\\.\…). (by @alexander-akait in #551) -
Prevent fallback to parent node_modules when the
exportsfield target file is not found. (by @xiaoxiaojx in #495) -
Imports field spec deviation: non-relative targets (e.g.
"#a": "#b") no longer re-enter imports resolution, aligning with the Node.js ESM spec wherePACKAGE_IMPORTS_RESOLVEdoes not recursively resolve#specifiers. (by @xiaoxiaojx in #503)Previously
{ "#a": "#b", "#b": "./the.js" }would chain-resolve#ato./the.js; now it correctly fails, matching Node.js behavior. -
Move
cachedJoin/cachedDirname/createCachedBasenamecaches from module-level globals to per-Resolver instances. This prevents unbounded memory growth in long-running processes — when a Resolver is garbage collected, its join/dirname/basename caches are released with it. (by @xiaoxiaojx in #507) -
Fixed when
tsconfig: trueis used (default config file) and notsconfig.jsonexists. (by @xiaoxiaojx in #502) -
Apply the
extensionAliasoption to theimportsfield to be align with typescript resolution. (by @alexander-akait in #549) -
Improved performance of the many plugins. (by @alexander-akait in #529)
-
Replace the
Set<string>-based resolver stack with a singly-linkedStackEntryclass that exposes a Set-compatible API. (by @xiaoxiaojx in #526)Each
doResolvecall now prepends a single linked-list node instead of cloning the entire Set, making stack push O(1) in time and memory. Recursion detection walks the linked list (O(n)), but because the stack is typically shallow this is much cheaper than cloning a Set per call. -
Cache the result of
stripJsonComments+JSON.parseinreadJsonusing aWeakMapkeyed by the raw file buffer. This avoids redundant comment-stripping and JSON parsing on every resolve call that reads tsconfig.json files (viastripComments: true), improving TsconfigPathsPlugin warm performance by ~20-35% depending on the depth of theextendschain. (by @xiaoxiaojx in #524) -
Avoid OOM in CachedInputFileSystem when duration is Infinity. (by @alexander-akait in #527)
v5.20.1
Patch Changes
-
Optimize
TsconfigPathsPluginand fix extends resolution bugs. (by @alexander-akait in #492) -
Improve resolver cache hit rate. (by @alexander-akait in #492)
v5.20.0
Features
- Added the
baseUrloption to override the tsconfig.json'sbaseUrl - Enabled trailing commas support for JSONC
Fixes
- Detect circular extends to prevent infinite loop in
tsconfig.json - Support JSONC comments in
tsconfig.json
v5.19.0
Features
- Added TsconfigPathsPlugin (replacement for
tsconfig-paths-webpack-plugin) .
v5.18.4
Fixes
- Allow subpath imports that start with
#/ - Handle
file:schema
v5.18.3
Fixes
- Fixed nonsensible intersection in types
Performance
- Decreased initial loading time
v5.18.2
Fixes
- [Types] FileSystem type
v5.18.1
Perf
- Fast path for parsing requests without
\0
v5.18.0
Features
- Added wildcards support for aliases
v5.17.1
Fixes
- fix:
exportsandimportsarray target resolving
Perf
- avoid creating a new array inside doResolve