@cloudflare/vite-plugin 0.0.0-e6fea1318 → 0.0.0-e7fce2523

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.
@@ -15,7 +15,7 @@ var ADDITIONAL_MODULE_TYPES = [
15
15
  // src/shared.ts
16
16
  var UNKNOWN_HOST = "http://localhost";
17
17
  var INIT_PATH = "/__vite_plugin_cloudflare_init__";
18
- var ADDITIONAL_MODULE_PATTERN = `__CLOUDFLARE_MODULE__(${ADDITIONAL_MODULE_TYPES.join("|")})__(.*?)__`;
18
+ var ADDITIONAL_MODULE_PATTERN = `__CLOUDFLARE_MODULE__(${ADDITIONAL_MODULE_TYPES.join("|")})__(.*?)__CLOUDFLARE_MODULE__`;
19
19
  var additionalModuleRE = new RegExp(ADDITIONAL_MODULE_PATTERN);
20
20
  var additionalModuleGlobalRE = new RegExp(
21
21
  ADDITIONAL_MODULE_PATTERN,
@@ -29,7 +29,7 @@ function stripInternalEnv(internalEnv) {
29
29
  return userEnv;
30
30
  }
31
31
 
32
- // ../../node_modules/.pnpm/vite@6.1.0_@types+node@18.19.76_jiti@2.4.2_lightningcss@1.29.2/node_modules/vite/dist/node/module-runner.js
32
+ // ../../node_modules/.pnpm/vite@6.1.0_@types+node@20.17.32_jiti@2.4.2_lightningcss@1.29.2/node_modules/vite/dist/node/module-runner.js
33
33
  var VALID_ID_PREFIX = "/@id/";
34
34
  var NULL_BYTE_PLACEHOLDER = "__x00__";
35
35
  var SOURCEMAPPING_URL = "sourceMa";
@@ -1394,13 +1394,6 @@ async function createModuleRunner(env, webSocket, viteRoot) {
1394
1394
  },
1395
1395
  {
1396
1396
  async runInlinedModule(context, transformed, module) {
1397
- if (module.file.includes("/node_modules") && !module.file.includes("/node_modules/.vite")) {
1398
- throw new Error(
1399
- `[Error] Trying to import non-prebundled module (only prebundled modules are allowed): ${module.id}
1400
-
1401
- (have you excluded the module via \`optimizeDeps.exclude\`?)`
1402
- );
1403
- }
1404
1397
  const codeDefinition = `'use strict';async (${Object.keys(context).join(
1405
1398
  ","
1406
1399
  )})=>{{`;
@@ -1426,13 +1419,6 @@ async function createModuleRunner(env, webSocket, viteRoot) {
1426
1419
  )
1427
1420
  });
1428
1421
  }
1429
- if (!additionalModuleRE.test(filepath) && filepath.includes("/node_modules") && !filepath.includes("/node_modules/.vite")) {
1430
- throw new Error(
1431
- `[Error] Trying to import non-prebundled module (only prebundled modules are allowed): ${filepath}
1432
-
1433
- (have you externalized the module via \`resolve.external\`?)`
1434
- );
1435
- }
1436
1422
  filepath = filepath.replace(/^file:\/\//, "");
1437
1423
  return import(filepath);
1438
1424
  }
@@ -1449,20 +1435,21 @@ async function getWorkerEntryExport(path, entrypoint) {
1449
1435
  }
1450
1436
 
1451
1437
  // src/runner-worker/index.ts
1438
+ var IGNORED_KEYS = ["self", "tailStream"];
1452
1439
  var WORKER_ENTRYPOINT_KEYS = [
1453
1440
  "fetch",
1441
+ "queue",
1454
1442
  "tail",
1443
+ "test",
1455
1444
  "trace",
1456
- "scheduled",
1457
- "queue",
1458
- "test"
1445
+ "scheduled"
1459
1446
  ];
1460
1447
  var DURABLE_OBJECT_KEYS = [
1461
- "fetch",
1462
1448
  "alarm",
1463
- "webSocketMessage",
1449
+ "fetch",
1464
1450
  "webSocketClose",
1465
- "webSocketError"
1451
+ "webSocketError",
1452
+ "webSocketMessage"
1466
1453
  ];
1467
1454
  var WORKFLOW_ENTRYPOINT_KEYS = ["run"];
1468
1455
  var entryPath = "";
@@ -1527,7 +1514,7 @@ function createWorkerEntrypointWrapper(entrypoint) {
1527
1514
  if (value !== void 0) {
1528
1515
  return value;
1529
1516
  }
1530
- if (key === "self" || typeof key === "symbol" || DURABLE_OBJECT_KEYS.includes(key)) {
1517
+ if (typeof key === "symbol" || IGNORED_KEYS.includes(key) || DURABLE_OBJECT_KEYS.includes(key)) {
1531
1518
  return;
1532
1519
  }
1533
1520
  const property = getWorkerEntrypointRpcProperty.call(
@@ -1625,7 +1612,7 @@ function createDurableObjectWrapper(className) {
1625
1612
  if (value !== void 0) {
1626
1613
  return value;
1627
1614
  }
1628
- if (key === "self" || typeof key === "symbol" || WORKER_ENTRYPOINT_KEYS.includes(key)) {
1615
+ if (typeof key === "symbol" || IGNORED_KEYS.includes(key) || WORKER_ENTRYPOINT_KEYS.includes(key)) {
1629
1616
  return;
1630
1617
  }
1631
1618
  const property = getDurableObjectRpcProperty.call(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/vite-plugin",
3
- "version": "0.0.0-e6fea1318",
3
+ "version": "0.0.0-e7fce2523",
4
4
  "description": "Cloudflare plugin for Vite",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -33,17 +33,19 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@hattip/adapter-node": "^0.0.49",
36
+ "@cloudflare/unenv-preset": "2.3.2",
37
+ "@mjackson/node-fetch-server": "^0.6.1",
38
+ "@rollup/plugin-replace": "^6.0.1",
39
+ "get-port": "^7.1.0",
37
40
  "picocolors": "^1.1.1",
38
41
  "tinyglobby": "^0.2.12",
39
- "unenv": "2.0.0-rc.15",
42
+ "unenv": "2.0.0-rc.17",
40
43
  "ws": "8.18.0",
41
- "@cloudflare/unenv-preset": "0.0.0-e6fea1318",
42
- "miniflare": "0.0.0-e6fea1318",
43
- "wrangler": "0.0.0-e6fea1318"
44
+ "miniflare": "0.0.0-e7fce2523",
45
+ "wrangler": "0.0.0-e7fce2523"
44
46
  },
45
47
  "devDependencies": {
46
- "@cloudflare/workers-types": "^4.20250321.0",
48
+ "@cloudflare/workers-types": "^4.20250508.0",
47
49
  "@types/node": "^22.10.1",
48
50
  "@types/ws": "^8.5.13",
49
51
  "magic-string": "^0.30.12",
@@ -52,10 +54,10 @@
52
54
  "typescript": "^5.7.2",
53
55
  "undici": "^5.28.5",
54
56
  "vite": "^6.1.0",
55
- "vitest": "~3.0.8",
56
- "@cloudflare/mock-npm-registry": "0.0.0",
57
+ "vitest": "~3.1.1",
58
+ "@cloudflare/workers-shared": "0.0.0-e7fce2523",
57
59
  "@cloudflare/workers-tsconfig": "0.0.0",
58
- "@cloudflare/workers-shared": "0.0.0-e6fea1318"
60
+ "@cloudflare/mock-npm-registry": "0.0.0"
59
61
  },
60
62
  "peerDependencies": {
61
63
  "vite": "^6.1.0",