@@ -46,7 +46,7 @@ const {
46
46
rekeySourceMap
47
47
} = require ( 'internal/source_map/source_map_cache' ) ;
48
48
const { pathToFileURL, fileURLToPath, URL } = require ( 'internal/url' ) ;
49
- const { deprecate } = require ( 'internal/util' ) ;
49
+ const { deprecate, emitExperimentalWarning } = require ( 'internal/util' ) ;
50
50
const vm = require ( 'vm' ) ;
51
51
const assert = require ( 'internal/assert' ) ;
52
52
const fs = require ( 'fs' ) ;
@@ -587,17 +587,21 @@ function resolveExportsTarget(pkgPath, target, subpath, basePath, mappingKey) {
587
587
if ( experimentalConditionalExports &&
588
588
ObjectPrototypeHasOwnProperty ( target , 'require' ) ) {
589
589
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 ;
592
594
} catch ( e ) {
593
595
if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
594
596
}
595
597
}
596
598
if ( experimentalConditionalExports &&
597
599
ObjectPrototypeHasOwnProperty ( target , 'node' ) ) {
598
600
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 ;
601
605
} catch ( e ) {
602
606
if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
603
607
}
@@ -700,6 +704,7 @@ Module._findPath = function(request, paths, isMain) {
700
704
701
705
const selfFilename = trySelf ( paths , exts , isMain , trailingSlash , request ) ;
702
706
if ( selfFilename ) {
707
+ emitExperimentalWarning ( 'Package name self resolution' ) ;
703
708
Module . _pathCache [ cacheKey ] = selfFilename ;
704
709
return selfFilename ;
705
710
}
0 commit comments