Skip to content

Commit 9fab73c

Browse files
committed
module: runtime deprecate "main" index and extension lookups
PR-URL: #37206 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 95391fe commit 9fab73c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2737,13 +2737,16 @@ change the value has been deprecated and will be disabled in the future.
27372737
### DEP0151: Main index lookup and extension searching
27382738
<!-- YAML
27392739
changes:
2740+
- version: REPLACEME
2741+
pr-url: https://github.com/nodejs/node/pull/37206
2742+
description: Runtime deprecation.
27402743
- version: v15.8.0
27412744
pr-url: https://github.com/nodejs/node/pull/36918
27422745
description: Documentation-only deprecation
27432746
with `--pending-deprecation` support.
27442747
-->
27452748

2746-
Type: Documentation-only (supports [`--pending-deprecation`][])
2749+
Type: Runtime
27472750

27482751
Previously, `index.js` and extension searching lookups would apply to
27492752
`import 'pkg'` main entry point resolution, even when resolving ES modules.

lib/internal/modules/esm/resolve.js

-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) {
9191
}
9292

9393
function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) {
94-
if (!pendingDeprecation)
95-
return;
9694
const { format } = defaultGetFormat(url);
9795
if (format !== 'module')
9896
return;

0 commit comments

Comments
 (0)