@cloudflare/vite-plugin 0.1.7 → 0.1.9

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 = {};
@@ -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) {