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