chore: update Cloudflare proxy build target to ESNext and adjust package import handling

Set the build target for the Cloudflare adapter to ESNext to keep json import attribute.
This commit is contained in:
dswbx
2025-10-01 09:00:11 +02:00
parent eecaeb7c06
commit ba9713587c
2 changed files with 4 additions and 1 deletions

View File

@@ -272,6 +272,7 @@ async function buildAdapters() {
), ),
tsup.build( tsup.build(
baseConfig("cloudflare/proxy", { baseConfig("cloudflare/proxy", {
target: "esnext",
entry: ["src/adapter/cloudflare/proxy.ts"], entry: ["src/adapter/cloudflare/proxy.ts"],
outDir: "dist/adapter/cloudflare", outDir: "dist/adapter/cloudflare",
metafile: false, metafile: false,

View File

@@ -20,7 +20,9 @@ export type WithPlatformProxyOptions = {
async function getPlatformProxy(opts?: GetPlatformProxyOptions) { async function getPlatformProxy(opts?: GetPlatformProxyOptions) {
try { try {
const { version } = await import("wrangler/package.json", { with: { type: "json" } }); const { version } = await import("wrangler/package.json", { with: { type: "json" } }).then(
(pkg) => pkg.default,
);
$console.log("Using wrangler version", version); $console.log("Using wrangler version", version);
const { getPlatformProxy } = await import("wrangler"); const { getPlatformProxy } = await import("wrangler");
return getPlatformProxy(opts); return getPlatformProxy(opts);