@cloudflare/vite-plugin 1.0.6 → 1.0.8

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.
@@ -1985,7 +1985,7 @@ var we = class {
1985
1985
  this.hasWritten || this.readyAnalytics && (this.hasWritten = true, this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.scriptId?.toString(), doubles: [this.data.requestTime ?? -1, this.data.coloId ?? -1, this.data.metalId ?? -1, this.data.coloTier ?? -1, this.data.userWorkerAhead === void 0 ? -1 : Number(this.data.userWorkerAhead)], blobs: [this.data.hostname?.substring(0, 256), this.data.dispatchtype, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] }));
1986
1986
  }
1987
1987
  };
1988
- var On = (t4) => ({ invoke_user_worker_ahead_of_assets: t4?.invoke_user_worker_ahead_of_assets ?? false, has_user_worker: t4?.has_user_worker ?? false, account_id: t4?.account_id ?? -1, script_id: t4?.script_id ?? -1 });
1988
+ var On = (t4) => ({ invoke_user_worker_ahead_of_assets: t4?.invoke_user_worker_ahead_of_assets ?? false, has_user_worker: t4?.has_user_worker ?? false, account_id: t4?.account_id ?? -1, script_id: t4?.script_id ?? -1, debug: t4?.debug ?? false });
1989
1989
  var Bc = { async fetch(t4, e, n) {
1990
1990
  let r, o = false, s = new we(e.ANALYTICS), i = new ue(e.UNSAFE_PERFORMANCE), a = i.now();
1991
1991
  try {
package/dist/index.js CHANGED
@@ -5784,7 +5784,8 @@ var z = /* @__PURE__ */ Object.freeze({
5784
5784
  // ../workers-shared/utils/types.ts
5785
5785
  var InternalConfigSchema = z.object({
5786
5786
  account_id: z.number().optional(),
5787
- script_id: z.number().optional()
5787
+ script_id: z.number().optional(),
5788
+ debug: z.boolean().optional()
5788
5789
  });
5789
5790
  var RouterConfigSchema = z.object({
5790
5791
  invoke_user_worker_ahead_of_assets: z.boolean().optional(),
@@ -14429,11 +14430,11 @@ function cloudflare2(pluginConfig = {}) {
14429
14430
  viteDevServer.httpServer,
14430
14431
  "Unexpected error: No Vite HTTP server"
14431
14432
  );
14433
+ const inputInspectorPort = await getInputInspectorPortOption(
14434
+ pluginConfig,
14435
+ viteDevServer
14436
+ );
14432
14437
  if (!miniflare) {
14433
- const inputInspectorPort = await getInputInspectorPortOption(
14434
- pluginConfig,
14435
- viteDevServer
14436
- );
14437
14438
  miniflare = new Miniflare(
14438
14439
  getDevMiniflareOptions(
14439
14440
  resolvedPluginConfig,
@@ -14442,12 +14443,11 @@ function cloudflare2(pluginConfig = {}) {
14442
14443
  )
14443
14444
  );
14444
14445
  } else {
14445
- const resolvedInspectorPort = await getResolvedInspectorPort(pluginConfig);
14446
14446
  await miniflare.setOptions(
14447
14447
  getDevMiniflareOptions(
14448
14448
  resolvedPluginConfig,
14449
14449
  viteDevServer,
14450
- resolvedInspectorPort ?? false
14450
+ inputInspectorPort
14451
14451
  )
14452
14452
  );
14453
14453
  }
@@ -14830,6 +14830,12 @@ function cloudflare2(pluginConfig = {}) {
14830
14830
  }
14831
14831
  }
14832
14832
  async function getInputInspectorPortOption(pluginConfig, viteServer) {
14833
+ if (pluginConfig.inspectorPort === void 0 || pluginConfig.inspectorPort === 0) {
14834
+ const resolvedInspectorPort = await getResolvedInspectorPort(pluginConfig);
14835
+ if (resolvedInspectorPort !== null) {
14836
+ return resolvedInspectorPort;
14837
+ }
14838
+ }
14833
14839
  const inputInspectorPort = pluginConfig.inspectorPort ?? await getFirstAvailablePort(DEFAULT_INSPECTOR_PORT);
14834
14840
  if (pluginConfig.inspectorPort === void 0 && inputInspectorPort !== DEFAULT_INSPECTOR_PORT) {
14835
14841
  viteServer.config.logger.warn(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/vite-plugin",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Cloudflare plugin for Vite",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -41,11 +41,11 @@
41
41
  "unenv": "2.0.0-rc.15",
42
42
  "ws": "8.18.0",
43
43
  "@cloudflare/unenv-preset": "2.3.1",
44
- "miniflare": "4.20250410.0",
45
- "wrangler": "4.11.0"
44
+ "miniflare": "4.20250416.0",
45
+ "wrangler": "4.12.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@cloudflare/workers-types": "^4.20250410.0",
48
+ "@cloudflare/workers-types": "^4.20250415.0",
49
49
  "@types/node": "^22.10.1",
50
50
  "@types/ws": "^8.5.13",
51
51
  "magic-string": "^0.30.12",
@@ -54,9 +54,9 @@
54
54
  "typescript": "^5.7.2",
55
55
  "undici": "^5.28.5",
56
56
  "vite": "^6.1.0",
57
- "vitest": "~3.0.8",
57
+ "vitest": "~3.1.1",
58
58
  "@cloudflare/mock-npm-registry": "0.0.0",
59
- "@cloudflare/workers-shared": "0.17.1",
59
+ "@cloudflare/workers-shared": "0.17.2",
60
60
  "@cloudflare/workers-tsconfig": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {