@@ -132,9 +132,6 @@ module.exports = {
132132} ;
133133
134134const { BuiltinModule } = require ( 'internal/bootstrap/realm' ) ;
135- const {
136- maybeCacheSourceMap,
137- } = require ( 'internal/source_map/source_map_cache' ) ;
138135const { pathToFileURL, fileURLToPath, isURL, URL } = require ( 'internal/url' ) ;
139136const {
140137 pendingDeprecate,
@@ -220,6 +217,8 @@ let { startTimer, endTimer } = debugWithTimer('module_timer', (start, end) => {
220217 endTimer = end ;
221218} ) ;
222219
220+ const lazyMaybeCacheSourceMap = getLazy ( ( ) =>
221+ require ( 'internal/source_map/source_map_cache' ) . maybeCacheSourceMap ) ;
223222const { tracingChannel } = require ( 'diagnostics_channel' ) ;
224223const onRequire = getLazy ( ( ) => tracingChannel ( 'module.require' ) ) ;
225224
@@ -1738,7 +1737,7 @@ function wrapSafe(filename, content, cjsModuleInstance, format) {
17381737 // Cache the source map for the module if present.
17391738 const { sourceMapURL, sourceURL } = script ;
17401739 if ( sourceMapURL ) {
1741- maybeCacheSourceMap ( filename , content , cjsModuleInstance , false , sourceURL , sourceMapURL ) ;
1740+ lazyMaybeCacheSourceMap ( ) ( filename , content , cjsModuleInstance , false , sourceURL , sourceMapURL ) ;
17421741 }
17431742
17441743 return {
@@ -1763,7 +1762,7 @@ function wrapSafe(filename, content, cjsModuleInstance, format) {
17631762
17641763 // Cache the source map for the module if present.
17651764 if ( result . sourceMapURL ) {
1766- maybeCacheSourceMap ( filename , content , cjsModuleInstance , false , result . sourceURL , result . sourceMapURL ) ;
1765+ lazyMaybeCacheSourceMap ( ) ( filename , content , cjsModuleInstance , false , result . sourceURL , result . sourceMapURL ) ;
17671766 }
17681767
17691768 return result ;
0 commit comments