fix: centralize Windows bundled Jiti loader policy (#62286) (thanks @chen-zhang-cs-code)

This commit is contained in:
Peter Steinberger
2026-04-07 13:06:28 +01:00
parent 9a6a1508c1
commit de3f742221
10 changed files with 196 additions and 22 deletions

View File

@@ -8,8 +8,8 @@ import { resolveBundledPluginPublicSurfacePath } from "./public-surface-runtime.
import {
buildPluginLoaderAliasMap,
buildPluginLoaderJitiOptions,
resolvePluginLoaderJitiTryNative,
resolveLoaderPackageRoot,
shouldPreferNativeJiti,
} from "./sdk-alias.js";
const OPENCLAW_PACKAGE_ROOT =
@@ -70,8 +70,9 @@ function resolvePublicSurfaceLocation(params: {
}
function getJiti(modulePath: string) {
const tryNative =
shouldPreferNativeJiti(modulePath) || modulePath.includes(`${path.sep}dist${path.sep}`);
const tryNative = resolvePluginLoaderJitiTryNative(modulePath, {
preferBuiltDist: true,
});
const sharedLoader = getSharedBundledPublicSurfaceJiti(modulePath, tryNative);
if (sharedLoader) {
return sharedLoader;