@@ -46,7 +46,7 @@ const {
4646 rekeySourceMap
4747} = require ( 'internal/source_map/source_map_cache' ) ;
4848const { pathToFileURL, fileURLToPath, URL } = require ( 'internal/url' ) ;
49- const { deprecate } = require ( 'internal/util' ) ;
49+ const { deprecate, emitExperimentalWarning } = require ( 'internal/util' ) ;
5050const vm = require ( 'vm' ) ;
5151const assert = require ( 'internal/assert' ) ;
5252const fs = require ( 'fs' ) ;
@@ -587,17 +587,21 @@ function resolveExportsTarget(pkgPath, target, subpath, basePath, mappingKey) {
587587 if ( experimentalConditionalExports &&
588588 ObjectPrototypeHasOwnProperty ( target , 'require' ) ) {
589589 try {
590- return resolveExportsTarget ( pkgPath , target . require , subpath ,
591- basePath , mappingKey ) ;
590+ const result = resolveExportsTarget ( pkgPath , target . require , subpath ,
591+ basePath , mappingKey ) ;
592+ emitExperimentalWarning ( 'Conditional exports' ) ;
593+ return result ;
592594 } catch ( e ) {
593595 if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
594596 }
595597 }
596598 if ( experimentalConditionalExports &&
597599 ObjectPrototypeHasOwnProperty ( target , 'node' ) ) {
598600 try {
599- return resolveExportsTarget ( pkgPath , target . node , subpath ,
600- basePath , mappingKey ) ;
601+ const result = resolveExportsTarget ( pkgPath , target . node , subpath ,
602+ basePath , mappingKey ) ;
603+ emitExperimentalWarning ( 'Conditional exports' ) ;
604+ return result ;
601605 } catch ( e ) {
602606 if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
603607 }
@@ -700,6 +704,7 @@ Module._findPath = function(request, paths, isMain) {
700704
701705 const selfFilename = trySelf ( paths , exts , isMain , trailingSlash , request ) ;
702706 if ( selfFilename ) {
707+ emitExperimentalWarning ( 'Package name self resolution' ) ;
703708 Module . _pathCache [ cacheKey ] = selfFilename ;
704709 return selfFilename ;
705710 }
0 commit comments