mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
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:
@@ -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,
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user