X Tutup
The Wayback Machine - https://web.archive.org/web/20210814022957/https://github.com/nodejs/node/commit/9fab73c73b
Skip to content
Permalink
Browse files
module: runtime deprecate "main" index and extension lookups
PR-URL: #37206
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
aduh95 committed Mar 19, 2021
1 parent 95391fe commit 9fab73c73bab5ed2513a24d81a72a60e629269d4
Showing with 4 additions and 3 deletions.
  1. +4 −1 doc/api/deprecations.md
  2. +0 −2 lib/internal/modules/esm/resolve.js
@@ -2737,13 +2737,16 @@ change the value has been deprecated and will be disabled in the future.
### DEP0151: Main index lookup and extension searching
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/37206
description: Runtime deprecation.
- version: v15.8.0
pr-url: https://github.com/nodejs/node/pull/36918
description: Documentation-only deprecation
with `--pending-deprecation` support.
-->

Type: Documentation-only (supports [`--pending-deprecation`][])
Type: Runtime

Previously, `index.js` and extension searching lookups would apply to
`import 'pkg'` main entry point resolution, even when resolving ES modules.
@@ -91,8 +91,6 @@ function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) {
}

function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) {
if (!pendingDeprecation)
return;
const { format } = defaultGetFormat(url);
if (format !== 'module')
return;

0 comments on commit 9fab73c

Please sign in to comment.
X Tutup