@@ -43,7 +43,7 @@ const {
4343 rekeySourceMap
4444} = require ( 'internal/source_map/source_map_cache' ) ;
4545const { pathToFileURL, fileURLToPath, URL } = require ( 'internal/url' ) ;
46- const { deprecate } = require ( 'internal/util' ) ;
46+ const { deprecate, emitExperimentalWarning } = require ( 'internal/util' ) ;
4747const vm = require ( 'vm' ) ;
4848const assert = require ( 'internal/assert' ) ;
4949const fs = require ( 'fs' ) ;
@@ -584,17 +584,21 @@ function resolveExportsTarget(pkgPath, target, subpath, basePath, mappingKey) {
584584 if ( experimentalConditionalExports &&
585585 ObjectPrototypeHasOwnProperty ( target , 'require' ) ) {
586586 try {
587- return resolveExportsTarget ( pkgPath , target . require , subpath ,
588- basePath , mappingKey ) ;
587+ const result = resolveExportsTarget ( pkgPath , target . require , subpath ,
588+ basePath , mappingKey ) ;
589+ emitExperimentalWarning ( 'Conditional exports' ) ;
590+ return result ;
589591 } catch ( e ) {
590592 if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
591593 }
592594 }
593595 if ( experimentalConditionalExports &&
594596 ObjectPrototypeHasOwnProperty ( target , 'node' ) ) {
595597 try {
596- return resolveExportsTarget ( pkgPath , target . node , subpath ,
597- basePath , mappingKey ) ;
598+ const result = resolveExportsTarget ( pkgPath , target . node , subpath ,
599+ basePath , mappingKey ) ;
600+ emitExperimentalWarning ( 'Conditional exports' ) ;
601+ return result ;
598602 } catch ( e ) {
599603 if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
600604 }
@@ -697,6 +701,7 @@ Module._findPath = function(request, paths, isMain) {
697701
698702 const selfFilename = trySelf ( paths , exts , isMain , trailingSlash , request ) ;
699703 if ( selfFilename ) {
704+ emitExperimentalWarning ( 'Package name self resolution' ) ;
700705 Module . _pathCache [ cacheKey ] = selfFilename ;
701706 return selfFilename ;
702707 }
0 commit comments