Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/chubby-hornets-greet.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/extension-alias-for-exports.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-dos-device-paths.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-exports-field-parent-fallback.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/fix-imports-field-no-chaining.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-join-cache-memory-leak.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-tsconfig-paths-missing-config.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/large-beds-sell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/neat-toys-serve.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/perf-stack-entry-linked-list.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/perf-tsconfig-strip-comments-cache.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/serious-zebras-cross.md

This file was deleted.

34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# enhanced-resolve

## 5.21.0

### Minor Changes

- Added promise API and support to resolve without `context` and `resolveContext`. (by [@alexander-akait](https://github.com/alexander-akait) in [#520](https://github.com/webpack/enhanced-resolve/pull/520))

- Add `extensionAliasForExports` option. When `true`, `extensionAlias` also applies to paths resolved through the `package.json` `exports` field. Off by default to match Node.js; opt in for full TypeScript-resolver parity with packages that ship `.ts` sources alongside the compiled `.js` they declare in `exports`. (by [@alexander-akait](https://github.com/alexander-akait) in [#554](https://github.com/webpack/enhanced-resolve/pull/554))

### Patch Changes

- Properly handle DOS device paths (`\\?\…` and `\\.\…`). (by [@alexander-akait](https://github.com/alexander-akait) in [#551](https://github.com/webpack/enhanced-resolve/pull/551))

- Prevent fallback to parent node_modules when the `exports` field target file is not found. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#495](https://github.com/webpack/enhanced-resolve/pull/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 where `PACKAGE_IMPORTS_RESOLVE` does not recursively resolve `#` specifiers. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#503](https://github.com/webpack/enhanced-resolve/pull/503))

Previously `{ "#a": "#b", "#b": "./the.js" }` would chain-resolve `#a` to `./the.js`; now it correctly fails, matching Node.js behavior.

- Move `cachedJoin`/`cachedDirname`/`createCachedBasename` caches 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](https://github.com/xiaoxiaojx) in [#507](https://github.com/webpack/enhanced-resolve/pull/507))

- Fixed when `tsconfig: true` is used (default config file) and no `tsconfig.json` exists. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#502](https://github.com/webpack/enhanced-resolve/pull/502))

- Apply the `extensionAlias` option to the `imports` field to be align with typescript resolution. (by [@alexander-akait](https://github.com/alexander-akait) in [#549](https://github.com/webpack/enhanced-resolve/pull/549))

- Improved performance of the many plugins. (by [@alexander-akait](https://github.com/alexander-akait) in [#529](https://github.com/webpack/enhanced-resolve/pull/529))

- Replace the `Set<string>`-based resolver stack with a singly-linked `StackEntry` class that exposes a Set-compatible API. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#526](https://github.com/webpack/enhanced-resolve/pull/526))

Each `doResolve` call 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.parse` in `readJson` using a `WeakMap` keyed by the raw file buffer. This avoids redundant comment-stripping and JSON parsing on every resolve call that reads tsconfig.json files (via `stripComments: true`), improving TsconfigPathsPlugin warm performance by ~20-35% depending on the depth of the `extends` chain. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#524](https://github.com/webpack/enhanced-resolve/pull/524))

- Avoid OOM in CachedInputFileSystem when duration is Infinity. (by [@alexander-akait](https://github.com/alexander-akait) in [#527](https://github.com/webpack/enhanced-resolve/pull/527))

## 5.20.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "enhanced-resolve",
"version": "5.20.1",
"version": "5.21.0",
"description": "Offers a async require.resolve function. It's highly configurable.",
"homepage": "http://github.com/webpack/enhanced-resolve",
"repository": {
Expand Down