Skip to content

Releases: webpack/enhanced-resolve

v5.21.0

23 Apr 17:25
35035ca

Choose a tag to compare

Minor Changes

  • Added promise API and support to resolve without context and resolveContext. (by @alexander-akait in #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 in #554)

Patch Changes

  • Properly handle DOS device paths (\\?\… and \\.\…). (by @alexander-akait in #551)

  • Prevent fallback to parent node_modules when the exports field 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 where PACKAGE_IMPORTS_RESOLVE does not recursively resolve # specifiers. (by @xiaoxiaojx in #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 in #507)

  • Fixed when tsconfig: true is used (default config file) and no tsconfig.json exists. (by @xiaoxiaojx in #502)

  • Apply the extensionAlias option to the imports field 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-linked StackEntry class that exposes a Set-compatible API. (by @xiaoxiaojx in #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 in #524)

  • Avoid OOM in CachedInputFileSystem when duration is Infinity. (by @alexander-akait in #527)

v5.20.1

16 Mar 22:32
ebc67d3

Choose a tag to compare

Patch Changes

v5.20.0

28 Feb 09:57

Choose a tag to compare

Features

  • Added the baseUrl option to override the tsconfig.json's baseUrl
  • 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

03 Feb 13:00

Choose a tag to compare

Features

  • Added TsconfigPathsPlugin (replacement for tsconfig-paths-webpack-plugin) .

v5.18.4

11 Dec 18:57

Choose a tag to compare

Fixes

  • Allow subpath imports that start with #/
  • Handle file: schema

v5.18.3

06 Aug 12:00

Choose a tag to compare

Fixes

  • Fixed nonsensible intersection in types

Performance

  • Decreased initial loading time

v5.18.2

24 Jun 05:30

Choose a tag to compare

Fixes

  • [Types] FileSystem type

v5.18.1

04 Feb 16:25

Choose a tag to compare

Perf

  • Fast path for parsing requests without \0

v5.18.0

20 Dec 13:28

Choose a tag to compare

Features

  • Added wildcards support for aliases

v5.17.1

23 Jul 14:18

Choose a tag to compare

Fixes

  • fix: exports and imports array target resolving

Perf

  • avoid creating a new array inside doResolve