@cloudflare/vite-plugin 0.0.0-5734014fd → 0.0.0-595f17092

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2051,10 +2051,7 @@ var vs = (t, e) => {
2051
2051
  return 0;
2052
2052
  };
2053
2053
  var ws = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
2054
- var Bt = (t) => {
2055
- let e;
2056
- return t?.run_worker_first !== void 0 ? e = t?.run_worker_first : t?.serve_directly !== void 0 ? e = !t.serve_directly : e = false, { html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", run_worker_first: e, serve_directly: !e };
2057
- };
2054
+ var Bt = (t) => ({ compatibility_date: t?.compatibility_date ?? "2021-11-02", compatibility_flags: t?.compatibility_flags ?? [], html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", account_id: t?.account_id ?? -1, script_id: t?.script_id ?? -1 });
2058
2055
  var Ve = class {
2059
2056
  constructor(e) {
2060
2057
  this.data = {};
@@ -2072,8 +2069,8 @@ var Ve = class {
2072
2069
  };
2073
2070
  var Yn = "public, max-age=0, must-revalidate";
2074
2071
  function Jn(t, e, n) {
2075
- let r = new Headers({ "Content-Type": e, ETag: `"${t}"` });
2076
- return Ds(n) && r.append("Cache-Control", Yn), r;
2072
+ let r = new Headers({ ETag: `"${t}"` });
2073
+ return e !== void 0 && r.append("Content-Type", e), Ds(n) && r.append("Cache-Control", Yn), r;
2077
2074
  }
2078
2075
  function Ds(t) {
2079
2076
  return !t.headers.has("Authorization") && !t.headers.has("Range");
@@ -2241,6 +2238,21 @@ async function Wn(t, e, n, r = 1) {
2241
2238
  await new Promise((i) => setTimeout(i, Math.pow(2, s++) * 1e3));
2242
2239
  }
2243
2240
  }
2241
+ function $s(t, e, n) {
2242
+ try {
2243
+ let r = new $(n);
2244
+ return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
2245
+ } catch (r) {
2246
+ return console.error("Error handling error", r), new $(r);
2247
+ }
2248
+ }
2249
+ function Bs(t, e, n) {
2250
+ try {
2251
+ t.setData({ requestTime: e.now() - n }), t.write();
2252
+ } catch (r) {
2253
+ console.error("Error submitting metrics", r);
2254
+ }
2255
+ }
2244
2256
  var Kn = class extends Us {
2245
2257
  async fetch(t) {
2246
2258
  let e, n = new ze(this.env.ANALYTICS), r = new ee(this.env.UNSAFE_PERFORMANCE), s = r.now();
@@ -2253,24 +2265,9 @@ var Kn = class extends Us {
2253
2265
  return n.setData({ status: u.status }), u;
2254
2266
  });
2255
2267
  } catch (o) {
2256
- return this.handleError(e, n, o);
2268
+ return $s(e, n, o);
2257
2269
  } finally {
2258
- this.submitMetrics(n, r, s);
2259
- }
2260
- }
2261
- handleError(t, e, n) {
2262
- try {
2263
- let r = new $(n);
2264
- return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
2265
- } catch (r) {
2266
- return console.error("Error handling error", r), new $(r);
2267
- }
2268
- }
2269
- submitMetrics(t, e, n) {
2270
- try {
2271
- t.setData({ requestTime: e.now() - n }), t.write();
2272
- } catch (r) {
2273
- console.error("Error submitting metrics", r);
2270
+ Bs(n, r, s);
2274
2271
  }
2275
2272
  }
2276
2273
  async unstable_canFetch(t) {
@@ -2280,7 +2277,7 @@ var Kn = class extends Us {
2280
2277
  async unstable_getByETag(t) {
2281
2278
  let e = await Wn(this.env.ASSETS_KV_NAMESPACE, t);
2282
2279
  if (!e || !e.value) throw new Error(`Requested asset ${t} exists in the asset manifest but not in the KV namespace.`);
2283
- return { readableStream: e.value, contentType: e.metadata?.contentType ?? "application/octet-stream" };
2280
+ return { readableStream: e.value, contentType: e.metadata?.contentType };
2284
2281
  }
2285
2282
  async unstable_getByPathname(t) {
2286
2283
  let e = await this.unstable_exists(t);