module: runtime deprecate "main" index and extension lookups

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Antoine du Hamel 2021-02-03 16:00:01 +01:00
parent 95391fe689
commit 9fab73c73b
2 changed files with 4 additions and 3 deletions

View File

@ -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.

View File

@ -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;