fix(runner): compile descriptor bundles without import meta

This commit is contained in:
Dotta 2026-09-02 18:37:44 -05:00
parent 62b79deb20
commit d414396011
2 changed files with 13 additions and 0 deletions

View File

@ -68,6 +68,14 @@ export async function bundleVerifiedProviderEntrypoints({ write = true } = {}) {
treeShaking: true,
write,
logLevel: "silent",
define:
format === "cjs"
? {
"import.meta.dirname": "__dirname",
"import.meta.url":
'require("node:url").pathToFileURL(__filename).href',
}
: undefined,
});
assertSelfContainedBundle(entrypoint, result);
return result;

View File

@ -16,6 +16,11 @@ test("provider entrypoints include self-contained ESM and descriptor-safe Common
const source = bundle.outputFiles[0].text;
assert.match(source, /^#!\/usr\/bin\/env node\n/);
}
assert.doesNotMatch(
verifiedResult.outputFiles[0].text,
/\bimport\.meta\b/,
entrypoint.name,
);
}
});