@@ -36,7 +36,7 @@ const {
36
36
rekeySourceMap
37
37
} = require ( 'internal/source_map/source_map_cache' ) ;
38
38
const { pathToFileURL, fileURLToPath, URL } = require ( 'internal/url' ) ;
39
- const { deprecate } = require ( 'internal/util' ) ;
39
+ const { deprecate, emitExperimentalWarning } = require ( 'internal/util' ) ;
40
40
const vm = require ( 'vm' ) ;
41
41
const assert = require ( 'internal/assert' ) ;
42
42
const fs = require ( 'fs' ) ;
@@ -576,17 +576,21 @@ function resolveExportsTarget(pkgPath, target, subpath, basePath, mappingKey) {
576
576
if ( experimentalConditionalExports &&
577
577
ObjectPrototype . hasOwnProperty ( target , 'require' ) ) {
578
578
try {
579
- return resolveExportsTarget ( pkgPath , target . require , subpath ,
580
- basePath , mappingKey ) ;
579
+ const result = resolveExportsTarget ( pkgPath , target . require , subpath ,
580
+ basePath , mappingKey ) ;
581
+ emitExperimentalWarning ( 'Conditional exports' ) ;
582
+ return result ;
581
583
} catch ( e ) {
582
584
if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
583
585
}
584
586
}
585
587
if ( experimentalConditionalExports &&
586
588
ObjectPrototype . hasOwnProperty ( target , 'node' ) ) {
587
589
try {
588
- return resolveExportsTarget ( pkgPath , target . node , subpath ,
589
- basePath , mappingKey ) ;
590
+ const result = resolveExportsTarget ( pkgPath , target . node , subpath ,
591
+ basePath , mappingKey ) ;
592
+ emitExperimentalWarning ( 'Conditional exports' ) ;
593
+ return result ;
590
594
} catch ( e ) {
591
595
if ( e . code !== 'MODULE_NOT_FOUND' ) throw e ;
592
596
}
@@ -689,6 +693,7 @@ Module._findPath = function(request, paths, isMain) {
689
693
690
694
const selfFilename = trySelf ( paths , exts , isMain , trailingSlash , request ) ;
691
695
if ( selfFilename ) {
696
+ emitExperimentalWarning ( 'Package name self resolution' ) ;
692
697
Module . _pathCache [ cacheKey ] = selfFilename ;
693
698
return selfFilename ;
694
699
}
0 commit comments