@@ -99,15 +99,14 @@ import {
9999 restoreMemoryPluginState ,
100100} from "./memory-state.js" ;
101101import { unwrapDefaultModuleExport } from "./module-export.js" ;
102- import { tryNativeRequireJavaScriptModule } from "./native-module-require.js" ;
103102import {
104103 fingerprintPluginDiscoveryContext ,
105104 resolvePluginDiscoveryContext ,
106105} from "./plugin-control-plane-context.js" ;
107106import { withProfile } from "./plugin-load-profile.js" ;
108107import {
109108 createPluginModuleLoaderCache ,
110- getCachedPluginSourceModuleLoader ,
109+ getCachedPluginModuleLoader ,
111110 type PluginModuleLoaderCache ,
112111} from "./plugin-module-loader-cache.js" ;
113112import type { PluginOrigin } from "./plugin-origin.types.js" ;
@@ -480,8 +479,8 @@ function runPluginRegisterSync(
480479
481480function createPluginModuleLoader ( options : Pick < PluginLoadOptions , "pluginSdkResolution" > ) {
482481 const moduleLoaders : PluginModuleLoaderCache = createPluginModuleLoaderCache ( ) ;
483- const loadSourceModule = ( modulePath : string ) => {
484- return getCachedPluginSourceModuleLoader ( {
482+ const createLoaderForModule = ( modulePath : string ) => {
483+ return getCachedPluginModuleLoader ( {
485484 cache : moduleLoaders ,
486485 modulePath,
487486 importerUrl : import . meta. url ,
@@ -495,18 +494,8 @@ function createPluginModuleLoader(options: Pick<PluginLoadOptions, "pluginSdkRes
495494 pluginSdkResolution : options . pluginSdkResolution ,
496495 } ) ;
497496 } ;
498- return ( modulePath : string ) : unknown => {
499- if ( shouldPreferNativeModuleLoad ( modulePath ) ) {
500- const native = tryNativeRequireJavaScriptModule ( modulePath , { allowWindows : true } ) ;
501- if ( native . ok ) {
502- return native . moduleExport ;
503- }
504- }
505- // Source .ts runtime shims import sibling ".js" specifiers that only exist
506- // after build. Jiti remains the dev/source fallback because it rewrites those
507- // imports against the source graph and applies SDK aliases.
508- return loadSourceModule ( modulePath ) ( toSafeImportPath ( modulePath ) ) ;
509- } ;
497+ return ( modulePath : string ) : unknown =>
498+ createLoaderForModule ( modulePath ) ( toSafeImportPath ( modulePath ) ) ;
510499}
511500
512501function resolveCanonicalDistRuntimeSource ( source : string ) : string {
0 commit comments